Skip to content

Instantly share code, notes, and snippets.

@zeuxisoo
Created June 27, 2011 05:08
Show Gist options
  • Select an option

  • Save zeuxisoo/1048337 to your computer and use it in GitHub Desktop.

Select an option

Save zeuxisoo/1048337 to your computer and use it in GitHub Desktop.
Detect current window zoom in or zoom out
<script lanugage="javascript" type="text/javascript">
(function(window, undefined) {
var currentWidth = window.screen.width;
window.onresize = function() {
if (window.screen.width < currentWidth) {
console.log("Zoom In");
}else{
console.log("Zoom Out");
}
currentWidth = window.screen.width;
}
})(window);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment