Sample browser window load and size change events

  • 2020-03-30 02:08:24
  • OfStack

 
window.onload = function() { 
var height = document.body.clientHeight; 
document.getElementById("vivS").style.height = (height - 20) + "px"; 
document.getElementById("emd").style.height = (height - 20) + "px"; 
document.getElementById("ob").style.height = (height - 20) + "px"; 
}; 

window.onresize = function() { 
height = document.body.clientHeight; 
document.getElementById("vivS").style.height = (height - 20) + "px"; 
document.getElementById("emd").style.height = (height - 20) + "px"; 
document.getElementById("ob").style.height = (height - 20) + "px"; 
}; 

Related articles: