开发者

jQuery function clear/stop

开发者 https://www.devze.com 2023-01-29 11:53 出处:网络
I have the following piece of code - jsfiddle example The problem i\'m having at the moment is layering up of the functions if you mouseover/off. I thought adding a stop function would help this out

I have the following piece of code - jsfiddle example

The problem i'm having at the moment is layering up of the functions if you mouseover/off. I thought adding a stop function would help this out but if you run the mouse over the trigger a few times it breaks and the fun开发者_运维问答ction stops working.

Would be great if someone could help me out on this!


you need to use stop(true, true). See the docs .stop( [ clearQueue ], [ jumpToEnd ] ) fiddle

jQuery("#offer-logo").hover(function() {
    jQuery("#offer-content").stop(true, true).show(250);
}, function() {
    jQuery("#offer-content").stop(true, true).hide(300);
});


Instead of stop try using .delay(100) Seems to fix it, at least on FF4.

0

精彩评论

暂无评论...
验证码 换一张
取 消