Created
July 8, 2013 19:11
-
-
Save cocuh/5951598 to your computer and use it in GitHub Desktop.
when resize window, html element id.cvs fit to full window size.
using jquery.
you should use this style also.
html{overflow: hidden;}
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
var resized,wid,hei;//global | |
resized=true | |
$(window).resize(function(){ | |
wid = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth; | |
hei = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight; | |
resized = true; | |
}) | |
function render(){ | |
if(resized){ | |
$('#cvs').attr({width:wid,height:hei}); | |
resied = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment