Wednesday, 10th September 2003
Javascript free rollovers
I’ve talked about image rollovers on this site before, but I’ve never seen a technique I like half as much as Pixy’s Fast rollovers, no preload needed. Like all good techniques, it’s so simple I’m surprised no one has thought of it before. The trick is that a single image is loaded containing the different rollover states, then positioned as the background of a fixed pixel size link element in such a way that only one of the states is shown. The :hover style simply changes the offset of the background, revealing the secondary (or even tertiary) state.