![]() |
Where to put Jquery Javascript
Hey,
I'm sure this is a stupid question, but I have continuously struggled with adding jquery Javascript to my genesis wordpress sites. For instance, I am following a tutorial on sliding backgrounds (http://www.webdevtuts.net/coding/cre...using-jquery/#). I have everything in place, but the javascript that creates the slide doesn't seem to be working. http://builder22.strangebirdmedia.com/?page_id=2 I tried adding the javascript to the wp_head Hook in Simple Hooks. I also tried adding it under Theme Setting>Header Scripts. What am I missing? Here is the script: <script type="text/javascript"> function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } $(function() { setInterval( "slideSwitch()", 5000 ); }); </script> I am not experienced in javascript, so please be patient with me. You have been a tremendous help in the past, present, and I can assume in the future, Thanks again, |
If it is supposed to fire in the head then the script box should work. You'll need to contact the creator of the script for assistance.
|
Ok, thank you.
|
You're welcome :):
|
| All times are GMT -5. The time now is 06:13 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.