Javascript examples for DOM Event:onresize
Using the addEventListener() method to attach the "resize" event on the window object.
<!DOCTYPE html> <html> <body> <p>Window resized <span id="demo">0</span> times.</p> <script> window.addEventListener("resize", myFunction); var x = 0;//from ww w. j a v a2s . c o m function myFunction() { var txt = x += 1; document.getElementById("demo").innerHTML = txt; } </script> </body> </html>