Topic: Why not use a CSS spritesheet for the viewer buttons?

Report Abuse Report Abuse
NateLawrence (Over 1 year ago)
I've been wondering since the beginning of the Preview and meant to ask again in your first significant viewer update, but why do you store each button as a separate PNG file?

With CSS image sprites you could simply put all the buttons into a single file so that as soon as that spritesheet is loaded, all button states are available, not to mention that any identical parts of different buttons ought to compress down to fewer bits. It uses fewer HTTP requests as well, so has efficiency advantages that I'm sure you're aware of, having worked with deep zoom collections.

Currently, the buttons' hover states are fetched on demand so that if I hover the mouse over one of the buttons while the medium res slideshow mode images are still loading it feels quite laggy waiting for the button's hover state image to download.