Javascript examples for DOM Event:Event Create
Simulate event resize
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w .j a v a2s . c om function resizeHandler(e) { console.log(e.type + ' triggered.'); } window.addEventListener('resize', resizeHandler); var resizeEvent = new Event('resize'); window.dispatchEvent(resizeEvent); } </script> </head> <body> </body> </html>