I need this div to enlarge when hovered and shrink back to default when the mouse is away from the div.
I did this:
$('.box').live('hover', function()
{
if($(this).height() == 145 && $(this).width() == 100)
{
$(this).animate({ height: '+=30px', width: '+=30px' }, 500)
$('.image img').animate({ height: '+=30px', width: '+=30px' }, 500);
}
else
{
$(this).animate({ height: '-=30px', width: '-=30px' }, 500)
$(this).next().find('.image img').animate({ height: '-=30px', width: '-=30px' }, 500);
}
});
Although, if I keep hovering and moving the mouse away rapidly, it keeps shrinking back down.
Demo: http://jsfiddle.net/avXJV/1/
I need it to stay intact when hovering and mouse out'ing so that none of the elements shrink to a tiny dot or go very large...