Detecting Browser Zoom ?

S

Stevo

I'm creating some DIVs that are sized in pixels. The content of the DIV
can be an image, object or embed and will usually be sized as 100% by
100%. So as the size of the DIV changes, the contents auto-scale with it.

I'm finding that if the page is zoomed in our out (IE7, FF3) then the
rest of the page (not under my control) zooms just fine, but my DIVs
remain at their original size. I haven't tried Opera and understand that
it has a better zoom than IE7/FF3.

I'd like to be able to create my DIVs also using percent values, and I
imagine this would probably solve the problem, but the container I
create into isn't necessarily the same as the size of my DIV. For
example, I might create a 500x400 DIV that centers itself within a
900x400 outer container. If I were to use percent values for width and
height, then my DIV would be 900x400 and that wouldn't be good.

So I'm wondering if anyone has any tips on whether there's a
cross-browser zoom detection script around. I'm hoping that there would
be something I can call that gives me a co-efficient zoom value that I
can use to dynamically resize my own DIV.

I've searched the FAQ and in the javascript google group archive and
found nothing useful. I've also googled this and found only some pretty
vague and useless info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top