Thursday, March 14, 2013

Quick smooth fade in transition with Jquery

This is what I use when I need to test a quick smooth fade in transition with Jquery

// hide and show this element                          
$selector.css('opacity', 0).animate({ 'opacity': 1 }, 400);

The reason why I don’t use .hide and .fadeIn is that it causes the layout to jump which opacity avoids.

No comments:

Post a Comment