Time for action – using the alternative argument format
This time we'll use the alternative syntax for supplying an easing function.
- Change the call to the
slideDown()
method inslideEasing.html
so that it appears as follows:$(this).addClass("on").next().slideDown({ easing: "easeOutBounce" });
- Save this version of the file as
slideEasingObject.html
.
What just happened?
By supplying an object literal as the first argument to the slideDown()
method, we are able to make use of the easing types provided by the plugin in an alternative syntax. In this example, we omit the duration
and complete
keys of the object and supply only the name of the easing type as a string.
Have a go hero – using easing
Try out some of the other easing methods that are available ...
Get jQuery 1.4 Animation Techniques Beginner's Guide 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.