0

I have made some hover states the show a div on hover of an element. It works really nice although if I move my mouse a few times quickly over it then it seems to break and the div no longer shows until i refresh the page.

Any ideas what might cause this as it has me baffled.

$('#s2_coffeetable').hover(function() {
    $('#popup1').stop().animate({
        opacity: 'toggle'
    }, 5)
}, function() {
    $('#popup1').stop().animate({
        opacity: 'toggle'
    }, 5)
});
$('#s2_drinks').hover(function() {
    $('#popup2').stop().animate({
        opacity: 'toggle'
    }, 100)
}, function() {
    $('#popup2').stop().animate({
        opacity: 'toggle'
    }, 100)
});
4

1 に答える 1

0

.stop( [clearQueue] [, jumpToEnd] ) このjQueryリファレンスを試してください...

.stop(true, true)

これら 2 つのパラメーターを stop 関数に渡します。

于 2012-07-27T09:32:46.180 に答える