$("#notification").slideDown("slow").delay(2000).slideUp("slow");
..動作しますが、#notificationにカーソルを合わせると、マウスアウトするまでタイマー/遅延が停止するように条件を追加したいと思います。次に、マウスアウトするとタイマーが開始し、最終的に要素が非表示になります(再度ホバーしない限り)。
ありがとう!
私があなたを正しく理解していれば、要素にカーソルを合わせたときに遅延/アニメーションを停止できるようにしたいですか?
clearQueue()
そのために使う
$(document).ready(function() {
if(cookieIsPresent) {
$("#notification").hover(function() {
$(this).stop(true, true).clearQueue(); // You might not need to use clearQueue() but test it out
}, function() {
$(this).delay(2000).slideUp("slow");
}).slideDown("slow").delay(2000).slideUp("slow");
}
});
onmouseover (onmouseover ではない) イベントを処理してみてください。