O'Reilly logo

Learning jQuery Third Edition by Karl Swedberg, Jonathan Chaffer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Multi-property easing

The showDetails() function almost accomplishes the "unfolding" effect we set out to achieve, but because the top and left properties are animating at the same rate, it looks more like a "sliding in" effect. We can subtly alter the effect by changing the easing equation to easeInQuart for the top property only, causing the element to follow a curved path rather than a straight one. Remember, however, that using any easing other than swing or linear requires a plugin, such as the effects core of jQuery UI (http://jqueryui.com/) or the standalone jQuery Easing plugin (http://gsgd.co.uk/sandbox/jquery/easing/), as follows:

$member.find('div').css({ display: 'block', left: '-300px', top: 0 }).each(function(index) { $(this).animate({ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required