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
  #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,
  #2  
Old 10-02-2012, 06:01 PM
SoZo's Avatar
SoZo SoZo is offline
Community Moderator
 
Join Date: Oct 2008
Location: Minneapolis, Minnesota
Posts: 47,500
Default

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.
__________________
John "Nicolas Flamel" Wright | SoZo's design | John Wright Photography

New to Genesis? Check out Genesis Explained.
"We are the music makers, and we are the dreamers of dreams..." - Arthur O'Shaughnessy

"Some days even my lucky rocket ship underpants don't help" - Calvin
StudioPress on Facebook
  #3  
Old 10-03-2012, 10:16 AM
benjamin_sbm benjamin_sbm is offline
Registered User
Genesis Member
 
Join Date: May 2012
Posts: 23
Default

Ok, thank you.
  #4  
Old 10-03-2012, 02:15 PM
SoZo's Avatar
SoZo SoZo is offline
Community Moderator
 
Join Date: Oct 2008
Location: Minneapolis, Minnesota
Posts: 47,500
Default

You're welcome
__________________
John "Nicolas Flamel" Wright | SoZo's design | John Wright Photography

New to Genesis? Check out Genesis Explained.
"We are the music makers, and we are the dreamers of dreams..." - Arthur O'Shaughnessy

"Some days even my lucky rocket ship underpants don't help" - Calvin
StudioPress on Facebook
 

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 02:07 PM.

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