Skip to content

Instantly share code, notes, and snippets.

@cocuh
Created July 8, 2013 19:11
Show Gist options
  • Save cocuh/5951598 to your computer and use it in GitHub Desktop.
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;}
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