Making an Element Slide Back to Disappear

$("span").mouseover(function(){   var i = $(this).index("span");   $("img").eq(i).animate({height:100}, 1000); }); $("span").mouseout(function(){   var i = $(this).index("span");   $("img").eq(i).animate({height:.1}, 1000); }); $("#container").mouseenter(function(e){     e.stopPropagation();     $("#images").stop(true).slideToggle(1000); }); $("#container").mouseleave(function(e){     e.stopPropagation();     $("#images").stop(true).slideToggle(1000); });

The .fadeTo( duration, opacity [, easing] [, callback]), .fadeTo( duration, opacity [, easing] [, callback]), and .fadeTo( duration, opacity [, easing] [, callback]) methods provide the duration, easing, and callback ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.