Adding Animation EffectsThe Yahoo! User Interface Library's Animation Utility allows you to add many sorts of animated effects to YUI objects. You can make graphics and other objects bigger or smaller; fade them in or out; animate colors; move objects across the page; move them along a specified path; and scroll text fields horizontally, vertically, or both. And of course, the combinations and possibilities are almost endless. In this example, we're going to show you how to animate the dialog we used in the previous task. The additions to the HTML are in Script 16.13, and the ones to the JavaScript are in Script 16.14. Script 16.13. This HTML has a different title and calls additional libraries than Script 16.10, but it is otherwise identical.
Script 16.14. The JavaScript that makes the animation happen.To add animation to an object:
|