May 2017
Intermediate to advanced
448 pages
10h 10m
English
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 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/).
.each((i, element) => { $(element) .animate({ left: 0, top: 25 * i },{ duration: 'slow', specialEasing: { top: 'easeInQuart' } }); });
The specialEasing option allows us to set a different ...
Read now
Unlock full access