Skip to content

Instantly share code, notes, and snippets.

@akrito
Created September 22, 2009 05:20
Show Gist options
  • Save akrito/190832 to your computer and use it in GitHub Desktop.
Save akrito/190832 to your computer and use it in GitHub Desktop.
adding zoom to surf
// Zoom text
var zoom = 1;
document.addEventListener(
'keydown',
function(e) {
if(e.keyCode == 187 && !e.shiftKey && e.ctrlKey && !e.altKey) {
zoom = zoom + .1
window.document.body.style.zoom = zoom;
};
if(e.keyCode == 189 && !e.shiftKey && e.ctrlKey && !e.altKey) {
zoom = zoom - .1
window.document.body.style.zoom = zoom;
};
if(e.keyCode == 48 && !e.shiftKey && e.ctrlKey && !e.altKey) {
zoom = 1
window.document.body.style.zoom = zoom;
};
},
false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment