dev life // dad life


The Perfect Popup

As a web developer, sometimes (rarely!) you just can’t get around creating a popup. Maybe you want to be able to define some terms, and can’t use a floating div because of Internet Explorer z-order bugs. Perhaps your client just really, really wants one.

This simple request– make a popup– is actually much more difficult than it seems. Window size and positioning requirements frequently preclude the use of target=”_blank”. Once you move to Javascript, though, you run into browsers running sans Javascript, popup blockers, and search engine unfriendliness.

To anyone who’s been in web development for a while, this isn’t a surprise: almost any seemingly small task becomes a maze of browser incompatibilities, security settings, search engine optimization, user experience, accessibility for the blind, and on and on. You need a toolkit you can return to, or you’ll end up spending hours or days on every “minor” feature.

Accessify provides some great scripts and tips to augment your bag of tricks. Returning to the subject at hand, they have this extensive walk-through of their perfect popup script. Web developers: it’s probably better than whatever you’re currently using for popups, on those rare occasions you have to use them. Everyone else: it’s a frightening demonstration of how much thought goes into what, on first glance, looks like one line of code.

Comments are closed.