Book Image

Moodle JavaScript Cookbook

Book Image

Moodle JavaScript Cookbook

Overview of this book

Moodle is the best e-learning solution on the block and is revolutionizing courses on the Web. Using JavaScript in Moodle is very useful to administrators and dynamic developers as it uses built-in libraries to provide the modern and dynamic experience that is expected by web users today.The Moodle JavaScript Cookbook will take you through the basics of combining Moodle with JavaScript and its various libraries and explain how JavaScript can be used along with Moodle. It will explain how to integrate Yahoo! User Interface Library (YUI) with Moodle. YUI will be the main focus of the book, and is the key to implementing modern, dynamic feature-rich interfaces to help your users get a more satisfying and productive Moodle experience. It will enable you to add effects, make forms more responsive, use AJAX and animation, all to create a richer user experience. You will be able to work through a range of YUI features, such as pulling in and displaying information from other websites, enhancing existing UI elements to make users' lives easier, and even how to add animation to your pages for a nice finishing touch.
Table of Contents (15 chapters)
Moodle JavaScript Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Animating with easing


Animation easing is the technique of adding acceleration or deceleration at different points during the animation to provide smoother transitions. It may also cause the transformation to exceed the destined value before returning to its final state. For example, when animating a change in height of an element, a bouncing effect could be achieved by causing the animation to overshoot the final value, then undershoot, then settle at the final value.

Fortunately, YUI3 includes many built-in easing types that we can add to our animations with very little extra code. In this example, we will use the bounce-out easing behavior in conjunction with a resize animation. This will make the bounds of the box appear to bounce as they reach the end of the animation.

A complete list of the many easing behaviors that are available in YUI3 is available at the following URL:

http://developer.yahoo.com/yui/3/api/Easing.html

Here, we can see the key steps in this animation by looking...