Created
July 10, 2010 15:29
-
-
Save stagas/470774 to your computer and use it in GitHub Desktop.
This file contains 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
function onResize() { | |
var new_height = window.innerHeight; | |
messages.style.height = (new_height - 132) + 'px'; | |
panel.style.height = new_height + 'px'; | |
} | |
window.onresize = onResize; | |
onResize(); |
This file contains 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
Resizing the canvas is a problem since if the window is small, and resized to be big, resizing the canvas will stretch the picture. | |
Solution is to init with a really big canvas (ie 1920x1080), since without scrollbars it'll be hidden until resizing the window. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment