开发者

jQuery function clear/stop

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜