title: The best way to check is mouse move outside window?
body: <p>So I have to check 4 sides if I want to limit mouse in window to take action like</p>
  
  <pre><code>$(document).on('mousemove',function(e){
    if (e.pageX &gt; 10 &amp;&amp; e.pageX&lt;$(window).width-10 &amp;&amp; e.pageY&lt; $(window).height()-10&amp;&amp; e.pageY &gt;10){
  //are there any better way?
  }
  
  });
  </code></pre>