Access browser's page zoom controls with javascript

后端 未结 3 1831
日久生厌
日久生厌 2020-12-10 07:58

I want to assign the browser\'s (IE/FF) page zoom controls (Menu: View/Zoom/Zoom In_Zoom Out) to two large \"(+)(-)\" icons on the web page

3条回答
  •  甜味超标
    2020-12-10 08:26

    Can't be done at all as far as I know. As has been discussed elsewhere on SO, it is possible to detect the browser's zoom level using a number of tricks. There's no way to set them from plain JavaScript.

    Maybe in a Firefox extension.

    Related:

    • Catch browser’s “zoom” event in JavaScript
    • Changing the browser zoom level
    • How to detect page zoom level in all modern browsers?

提交回复
热议问题