December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("img").mouseover(function(){ $(this).animate( {width:"200px", opacity:1}, 1000); }); $("img").mouseout(function(){ $(this).animate( {width:"100px", opacity:.3}, 1000); });
Similar to the way you use the height and width to create a sliding effect, you can use them to create a resize animation. The difference between a slide and a resize is that the aspect ratio of the image is maintained on a resize, so the element appears to be growing or shrinking rather than being unfolded or untucked.
To create a resize animation, you need to specify both height and width in the .animate() statement, or one of them has to be auto in the CSS settings and you can only animate ...
Read now
Unlock full access