Question about image rollovers

When creating image rollovers, such as navigation bars, what technology is better and recommended for professional use? CSS sprites or JavaScript?

You might as well use CSS sprites for that, as they are very reliable and quick to load. I can’t see any advantage to using JS, but can see disadvantages. A user may have JS turned off, and some devices may not have great JS support.

Thanks for the reply, Ralph.

I googled about this subject. Other developers mentioned about using CSS sprites for rollovers also. There was a time when users implemented rollovers, they would use inline event handlers (messy), in cases people with limited knowledge in web development used this. I’ve seen other cases when developers created scripts for rollovers, or even more complex ones, which was why I was wondering what is better to use.

I was considering creating a simple library for this feature.


I will use CSS sprites.