views:

731

answers:

1

There are two occasions on my web page where I don't want Firefox to automatically scale the images when zooming in and out.

Can I circumvent this feature on these images specifically, and have the rest of the images zoom as normal in Firefox (if that's what the users has set in his/her preferences)?

+3  A: 

There is no way to mark or otherwise prevent an image from being zoomed when the user requests zooming.

You could use window.onresize and detect the zoom amount using one of the techniques described at Detecting Page Zoom in Firefox 3 (And Others). Once you know the zoom amount, you could apply that percentage adjustment to the images you want to leave at a fixed size.

The whole thing is a house of cards though. The JavaScript-only solution does not detect zoom amount when the page is first loaded, so you'll need a Flash component on the page just to detect the zoom amount. Also, the actual effect of the zooming will be jarring for the user. The image resizing will lag slightly behind the user's zoom setting, causing the page to reflow, possibly moving the content they were trying to zoom in on in the first place.

Grant Wagner