Dynamically autosize DIV on resolution change - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Div

Description

Dynamically autosize DIV on resolution change

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from www. j av a2  s .co m
var onResizeHandler = function() {
    // add your resize handling here
    console.log("resize");
}
window.onresize = onResizeHandler;
    }

      </script> 
   </head> 
   <body> 
      <p>Try to resize the browser window or zoom in or out and you will see a message in console</p>  
   </body>
</html>

Related Tutorials