Sunday, June 11, 2006

Sprites What are they good for?

I never particularly cared much for them. I had nothing against them. I personally (unlike others) found having all the images in one graphic file easier to maintain; and yes it was less of a server hit but I never had a time, until now, where I found sprites to be indispensable.

I have a complex image: an intertwined pie-chart that highlights as different parts are rolled over. And now - I have a use for sprites. I cannot see how this user interface could have been accomplished without sprites. One can even imagine, that with javascript, one can display different information based on other factors than simply the mouseover.

For example a class name could be added to the div (via server-side script) based on almost any factor and then different information could be shown to different users (or even the same user) as needed.

This user interface is for the marketing department of a well-know company. It displays the course work and tests necessary for employees a variety of certification. So class names can be appended to the div; and javascript can display different text as needed. Example: If user has completed course X then show "Completed" elseif show "In Progress" else "Not Started".