StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-02-2012, 03:23 PM
benjamin_sbm benjamin_sbm is offline
Registered User
Genesis Member
 
Join Date: May 2012
Posts: 23
Default 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,
 

Tags
javascript, jquery, not working

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:00 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.