aculo.us).
The Fx.Base is very similar to Script.aculo.us, with the other classes extending it as need
be. Of the Fx classes, only three offer up specific animation functionality:
??? Fx.Style:Modifies an element style property over time
??? Fx.Scroll: Scrolls the window or an element with overflow:scroll
??? Fx.Slide: Shows or hides content using a slide animation
The other Fx classes are utility classes to handle various animation duties such as transitions
(Fx.Transitions) or applying multiple style effects to multiple elements at once
(Fx.Elements). The Style object resembles your approach in that the animation begins only
after the start() method is executed.
var anim = new Fx.Style('elementID', left',{duration:500});
anim.start(0, 100);
Summary
There can be a place for visual effects in your work because they can solve usability issues
inherent within even standard web pages. You built your own animation class and in the
process discovered many of the concepts discussed over the last few chapters. Finally, you saw
how the popular JavaScript libraries handle animation and which additional features they
have to offer up.
In Chapter 7, Stuart Langridge takes a good look at one of the most common uses for
DOM scripting: formvalidation.
CHAPTER 6 n VISUAL EFFECTS 146
Form Validation and
JavaScript
By Stuart Langridge
Most web applications use the