timeout - jQuery hover - perform next transition only after current is over -



timeout - jQuery hover - perform next transition only after current is over -

how time transitions out, next 1 start when current one's finished? way jumps next transition while in middle of current, , looks jumpy, when hover on bunch of links quickly.

here's link how looks http://dynamo.kco.ie/about-us/clients , , code is:

function slideshow() { $("#list .client").unbind('mouseover'); var imgsrc = $(this).attr('rel'); var image1 = $("#clientimage1"); var image2 = $("#clientimage2"); if(image1.is(":visible")){ image2.attr('src', imgsrc); image2.stop(true, true).show("slide", { direction: "down" }, 400, function() { $("#list .client").mouseover(slideshow); }); image1.stop(true, true).hide("slide", { direction: "up" }, 400); //image1.hide(); } else{ image1.attr('src', imgsrc); image1.stop(true, true).show("slide", { direction: "down" }, 400); image2.stop(true, true).hide("slide", { direction: "up" }, 400); } // binding $("#list .client").mouseover(slideshow); } $("#list .client").mouseover(function(){ slideshow(); }); any ideas?

edit:

thanks much help, got work hoverintent! working code:

$(document).ready(function(){ $("#clientimage2").hide(); $("#list .client").hoverintent(config); }); var config = { over: slideshow, // function = onmouseover callback (required) timeout: 600, // number = milliseconds delay before onmouseout out: donothing // function = onmouseout callback (required) }; function slideshow() { var imgsrc = $(this).attr('rel'); var image1 = $("#clientimage1"); var image2 = $("#clientimage2"); if(image1.is(":visible")){ image2.attr('src', imgsrc); image2.stop(true, true).show("slide", { direction: "down" }, 600); image1.stop(true, true).hide("slide", { direction: "up" }, 600); } else{ image1.attr('src', imgsrc); image1.stop(true, true).show("slide", { direction: "down" }, 600); image2.stop(true, true).hide("slide", { direction: "up" }, 600); } } function donothing(){}

try changing stop()'s from

stop(true,true) stop(true,false)

jquery timeout hover

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -