PDA

View Full Version : Featured Content Glider pause on hover



fileserverdirect
03-09-2011, 10:23 PM
1) Script Title: Featured Content Glider

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/featuredcontentglider.htm

3) Describe problem: Is there any way to make the auto rotate pause on mouse hover, then resume on mouse exit?

fileserverdirect
03-09-2011, 10:46 PM
Figured it out on my own.
Just add the following before the end of the glide function:


glide:function(config, showpage, isprev){
var selected=parseInt(showpage)
if (selected>=config.$contentdivs.length){ //if no content exists at this index position
alert("No content exists at page "+(selected+1)+"! Loading 1st page instead.")
selected=0
}
var $target=config.$contentdivs.eq(selected)
//Test for toggler not being initialized yet, or user clicks on the currently selected page):
if (config.$togglerdiv.attr('lastselected')==null || parseInt(config.$togglerdiv.attr('lastselected'))!=selected){
var $selectedlink=config.$toc.eq(selected)
config.nextslideindex=(selected<config.$contentdivs.length-1)? selected+1 : 0
config.prevslideindex=(selected==0)? config.$contentdivs.length-1 : selected-1
config.$next.attr('loadpage', config.nextslideindex+"pg") //store slide index to go to when "next" link is clicked on
config.$prev.attr('loadpage', config.prevslideindex+'pg')
var startpoint=(isprev=="previous")? -config.startpoint : config.startpoint
$target.css(config.leftortop, startpoint).css("zIndex", this.csszindex++) //hide content so it's just out of view before animating it
var endpoint=(config.leftortop=="left")? {left:0} : {top:0} //animate it into view
$target.animate(endpoint, config.speed)
config.$toc.removeClass('selected')
$selectedlink.addClass('selected')
config.$togglerdiv.attr('lastselected', selected+'pg')
}
$target.hover(function(){featuredcontentglider.cancelautorotate(config.togglerid)}, function(){featuredcontentglider.autorotate(config)})

},

mrodenhaus
03-24-2011, 02:16 PM
I added the pause on hover line... it works.. but it gets glitchy sometimes...
I am not sure why?...
http://www.advantagelumber.com/index2.html

You can see the problem I am having here

PLEASE HELP :confused:

mrodenhaus
03-24-2011, 02:59 PM
hover on and off rapidly... it really gets messed up!
http://www.advantagelumber.com/index2.html

Is there a fix for this?