Vince P
Vince P

Reputation: 1791

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 function stops working.

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

Upvotes: 1

Views: 308

Answers (2)

Josiah Ruddell
Josiah Ruddell

Reputation: 29831

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);
});

Upvotes: 1

Brad Christie
Brad Christie

Reputation: 101604

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

Upvotes: 0

Related Questions