Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Detect zoom level using Javascript
branch: master

This branch is 68 commits behind tombigel:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tools
README.md
detect-zoom.js
test-page.html

README.md

Javascript Zoom Detector

Detect the zoom level of the user's browser using Javascript. This can be used to show higher-resolution canvas or img when necessary.

It may not be complete; I need help testing different browsers. Patches welcome.

Usage:

<script src=detect-zoom.js></script>
<script>
  var zoom = DetectZoom.zoom();

  console.log(zoom);
</script>

Demo

Dimensions test

License

Detect-zoom is dual-licensed under the WTFPL and MIT license, at the recipient's choice.

Something went wrong with that request. Please try again.