Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery Cycle Plugin Re: Jquery Cycle Plugin

#59271

It took me a while to see what you meant and how exactly you were trying to achieve it. I’ll try and explain it as simply as possible – I’m not trying to patronize just hoping to make it easy to understand. I can see one clear problem with your current approach and it lies in the follow code:

Code:
$(document).ready(function(){
$(“#slide_navigation a.activeSlide”).hover(makeTall,makeShort);
}

This reads in english as follows: Do this when the page becomes ‘ready’, find the navigation tab for the active slide and add an event to it when the mouse hovers and when the mouse stops hovering.

The problem is with the first part of that statement "Do this when the page becomes ‘ready’". This only happens once, when the page has finished loading and, crucially, before the slideshow has started. This means that when you try and grab the active slide a) there isn’t one, and b) even if there was it would not change when the slideshow moved forward because you are only carrying out that instruction once.

You can either move your code into the jQuery cycle before/after callbacks or change your makeTall/makeShort functions to check if the link being hovered is the active slide.