Created
September 22, 2009 05:20
-
-
Save akrito/190832 to your computer and use it in GitHub Desktop.
adding zoom to surf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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