Accessible Product Rollover in CSS

The following is a test to duplicate Bob Regan's Flash "Accessible Product Rollover" (See part one and part two) with CSS and animated GIFs (and no JavaScript). I've also posted a web log entry about this experiment.

Demo

Macromedia MX


Pro/Cons

Pros

Cons

Differences

Although this demo tries to mimic the functionality of Mr. Regan's Flash movie exactly, there are some differences in appearance. I've tried to note them all here. Please email me if you notice more.

Differences for all implementations

Browser-specific differences

Previous Bugs

How it was done...

You can view the source to see any and all code used for this, but I'd like to give a brief "plain English" explanation of the steps involved. Refering to the source while reading this will help with the explanation.

First of all the HTML consists of a page division (div) containing a heading (an h2 element containing the text "Macromedia MX") and an unordered list (ul) containing several list-items with links (a elements inside li elements). Each link then contains a span element with the application title (Dreamweaver, Flash, Cold Fusion, etc.) in plain text. Each one of the list-items also has a unique ID value so I could add the correct image to it. You should be able to get a quick understanding of the HTML by viewing toggling the CSS on this page. Note: You'll need JavaScript for this link to work. Reload the page or click the link twice when you want to refresh the styles.

The images folder contains two animated GIFs for each one of the list-items: A "rollover" image and a "rollout" image. The "rollover" image image animates from a small icon to a large icon. The "rollout" image does the opposite.

Now the CSS. There's a lot to the positioning that I won't get into, but the idea is that each link sits side-by-side and has a size proportional to the size of the animated GIFs. Each of these links' default background image is the corresponding "rollout" image. When a user activated the :hover, :active, or :focus states (pseudo-class state) of the links, I switch the background image to the "rollover" image. Since the plain text title is contained within a child element (span). I can control it separately also based on the parent link's pseudo-class state. I position and hide/show the text below the animated images.

Browsers tested


Thanks to Jacob Villanueva and Philippe Wittenbergh for the help with Mac testing. Thanks to Bob Regan for his help and inspiration.