私のナビゲーションリンク画像で機能する次のホバースクリプトがあります。
$("nav a").hover(
function() {
$(".current", this).animate({
opacity: 1
}, {
duration: 300,
specialEasing: {
opacity: 'linear',
},
});
}, function() {
$(".current", this).animate({
opacity: 0
}, {
duration: 2000,
specialEasing: {
opacity: 'linear',
},
});
});
I am wondering there is a way of intercepting the animation if the user moves the cursor out of the hover div and then back into it before the original animation has finished. If the user moves the cursor back into the div I would want the animation to fade the opacity of the image in the .current div to 1 immediately.
I hope this is clear, and would be glad of any help.
Thanks,
Nick