简体   繁体   中英

add javascript to wordpress page

I want to add filmstrip to my page that scrolls images without using a plugin. So I found nice javascript online ( http://jsfiddle.net/benknowles/TUwqn/2/ ) that does exactly what I want to do. Here is the script:

jQuery(document).ready(function($) {
    $('#filmstrip').filmstrip({
        interval : 3000
    });
});

Here is what I have done so far. I uploaded the javascript to my server and added in my footer in WordPress. Then I copied the HTML as from the example on http://jsfiddle.net/benknowles/TUwqn/2/ and just replaced with location of my images. Added the css as from the example but I just can't get it to display correctly.

Am I missing something?

As j08691 alluded to, you need to include this file in your html before the code block:

jQuery(document).ready(function($) {
  $('#filmstrip').filmstrip({
    interval: 3000
  });
});

Which gives you access to the filmstrip function

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM