The first method I ever used for multiple state buttons was to create a
graphic for each button for each state: AboutUs_on, AbooutUs_over,
AboutUs_out, etc. That works great when there are just a few buttons.
I'm creating interfaces now with many more buttons than "just a few".
I solved the maintenance problem by having generic button images, one
for each state, and having them be background images for text
containers, DIVs in this case, defined in external stylesheets. On
mouseover, mouseout, etc, I swap the classnames.
This does a couple of things for me. One, it decreases maintenance
because there are fewer images to create and only text to maintain.
Two, I can change the look and feel of a set of buttons by changing
what stylesheeet is referenced.
The problem is that when the classes swap, the transition is not
seamless. There is a flicker as the images swap out.
I've tried using javascript to preload the images hoping the browser
would cache them, but it doesn't affect background images, and there is
still a flicker.
I've tried making the background-image include both "on" and "off"
images, using classes to change the position of the background so that
only the "on" portion or "off" portion shows, and there is still a
flicker.
I've tried clipping, which didn't flicker. However, it didn't change
the image either.
Opera and Firefox appear to handle the transition the best, but because
this is a retail app it has to work in all browsers. Has anyone else
encountered this problem and solved it, and if so, how?
You can see what I'm trying to do at
http://new.seritas.com/buttons.asp. Any help would be appreciated.
- Bill in Kansas City, MO