Hide on mouse leave - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:mouseleave

Description

Hide on mouse leave

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-git.js"></script> 
  <style id="compiled-css" type="text/css">

#nav {//from w ww.j  av a2  s. c  om
   width: 100px;
   height: 100px;
   background-color: #000;
}


      </style> 
  <script type="text/javascript">
    $(window).on('load', function() {
$("#nav").mouseleave(function(){
    $(this).hide();
});
    });

      </script> 
 </head> 
 <body> 
  <div id="nav"></div>  
 </body>
</html>

Related Tutorials