1//listen for window resize event
2window.addEventListener('resize', function(event){
3 var newWidth = window.innerWidth;
4 var newHeight = window.innerHeight;
5});
1function resizedw(){
2 // Haven't resized in 100ms!
3}
4
5var doit;
6window.onresize = function(){
7 clearTimeout(doit);
8 doit = setTimeout(resizedw, 100);
9};
10