Disables zooming in browsers that do not support the viewport meta tag.
- CSS zoom must be supported by the browser for nozoom.js to prevent zooming. The interceptEvents option is automatically disabled if CSS zoom is not supported.
- addEventListener
- Object.defineProperty
- Array.prototype.forEach
- document.createEvent
This is an object containing the following properties:
cssZoom
- Indicates whether the browser supports CSS zoom.cssZoomReset
- Indicates whether the browser supports CSS zoom reset.
Set this to true
to use properties based on the full screen size to calculate
the zoom factor. The default value is false
.
Returns the current zoom factor. Pass a boolean value to override
nozoom.useFullscreen
.
Returns an object with x
and y
properties that contain the adjusted x and y
values for the current zoom factor. The third argument can be used to override
nozoom.useFullscreen
.
Initialize nozoom with the following options:
-
useFullscreen
:boolean
- Setsnozoom.useFullscreen
. -
disableTextSelection
:boolean
- Whether to disable text selection and only allow scrollbars to scroll. This disables touch gestures in some browsers. The default value isfalse
. -
extendMouseEvent
:boolean
- Whether to extend mouse event objects to include additional coordinate properties that account for the zoom level. Ex:clientXZoom
. The default value isfalse
. -
interceptEvents
:boolean
- Whether to intercept all mouse events and adjust coordinate values for the zoom factor. The default value istrue
.