Chapter 5. ImageMachine

Application FeaturesJavaScript Techniques
• Dynamic Image Rollover Code Generator and Viewer• JavaScripting Defensively
• Code Accommodates Lesser JavaScript Browsers• The Power of Global Variables
• Flexible and Extensible HTML Attribute Settings• Search and Replace in JavaScript 1.1 and 1.2
• Supports Image Rollovers for MouseDown Events 

Everywhere you look in these chapters, the applications are designed with one person in mind: the user. You know, the ones we want to arrive like lemmings to our web sites, then bump up our traffic, buy our stuff, and download our software. This application breaks the mold. This one’s for you: the developer, webmaster, or designer.

Although DHTML has enhanced the capabilities of what can happen when we put our mouse-pointer arrows over some frame, widget, button or stylesheet, the image rollover is still one of the hottest and most widely used techniques on the Net.

Generating the JavaScript to enable the rollovers isn’t rocket science, but it sure would make life easier to have an application that spews nicely formatted image rollover code. That way, we coders can just drop it in our pages. Enter ImageMachine. Figure 5.1 shows the opening look as you open ch05/index.html.

ImageMachine ready for action

Figure 5-1. ImageMachine ready for action

The app is fairly easy to use. You just have to make a few decisions about your ...

Get JavaScript Application Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.