Javascript examples for DOM Event:onresize
Execute a JavaScript when the browser window is resized:
<!DOCTYPE html> <html> <body onresize="myFunction()"> <p id="demo"></p> <script> function myFunction() {//from w w w .j ava 2s .c om var w = window.outerWidth; var h = window.outerHeight; var txt = "Window size: width=" + w + ", height=" + h; document.getElementById("demo").innerHTML = txt; } </script> </body> </html>