O'Reilly logo

JavaScript Application Cookbook by Jerry Bradenbaugh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required