Check event type - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:bind

Description

Check event type

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.3.js"></script> 
      <script type="text/javascript">
    window.onload=function(){/* www.j  ava  2 s  . co  m*/
 $(window).bind('DOMMouseScroll keydown resize', function(ev) {
 console.log(ev.type)
  })
    }

      </script> 
   </head> 
   <body> 
      <div style="height:600px"> 
      </div>  
   </body>
</html>

Related Tutorials