Practically speaking, DHTML effects should be used sparingly. First off, there are many JavaScript bugs associated with positioning objects and manipulating their clipping regions. Careful testing and defensive coding practices (as discussed in Chapter 22) would need to be applied. Second, many of these effects, as we saw with rollovers, can be created in technologies other than JavaScript such as CSS or Flash. Animations in particular raise many questions. While you can implement them with JavaScript, you may find that the animations strobe or move jerkily. Without significantly complex programming, you won’t have perfect animations under JavaScript. However, by using Flash or even simple animated GIFs, you can achieve some very interesting effects—often with far less complexity. We’re big fans of picking the most appropriate technology in which to implement any particular solution. For fancy effects, the appropriate solution is rarely JavaScript. A wonderful rule of thumb is that effects for the sake of effects are not worth the effort. JavaScript should be used to add functionality—not glitz—to your site.
If you’re dead set on using JavaScript, there are many interesting effects that can be achieved. A few examples are presented at the support site at www.javascriptref.com as well as at the numerous JavaScript library sites online, such as DynamicDrive (www.dynamicdrive.com).