开发者

Adjusting browser zoom level with Javascript

In the 2-frame 'rows=' frameset I have, if a user change of the zoom level to less than the 125% value that I coded for, they will see "dead space" between the frames.

This question: How to detect page zo开发者_Go百科om level in all modern browsers? shows how to detect the browser's zoom level.

Is it possible to adjust the browser's zoom level using Javascript so I can keep users from changing the zoom outside of the desired levels?

Or have I simply forgotten a default coding consideration of some kind? (I've seen CSS's 'zoom' style, where presumably default zoom levels can be set.)

I am also seeing document.body.style.zoom, so seems we could do something like:

if (zoomLevelChange)
  {document.body.style.zoom= [some calculation]; }


See How to detect page zoom level in all modern browsers?

Can you edit your question to only be about "adjusting", since the other one has detection covered?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜