I'm using the following code to show a box when you mouseover a certain div and have set the delay on the fade out but is there some way of cancelling the fadeOut effect if the user goes back on to the div?
jQuery("#cart-box").hover(function()
{
jQuery("#cart-container").fadeIn('fast');
}, function( )
{
jQuery("#cart-container").delay(800).fadeOut('fast');
});
Code for the divs
<div class="cart-box" id="cart-box"><a href="#">Cart</a><div class="cart-container" id="cart-container"><div class="cart-contents">contents</div></div></div>
Thinking about it I think it's probably a case me needing to stop the fadeIn function working if you go away from the div and go back.
Any thoughts would be helpful as still very new to jQuery!
On a side note what effect should I use to have the box expand from nothing to the height of the content instead of just fading in?