javascript - How I can use mouse events with Jquery -


i'm tryng configure list of users in chat adding function slide http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_slide_down similar facebook, when mouse on focus, chat container hidden

i'm using jquery-1.8.1.min.js in proyect , have principal container id , can configure events

$("maincontainer").someevent(function () { code... } 

i can use click, haven't mouse event when put cursor inside example.

i need .mousedown(), .mouseleave(), .mousemove(), hover(), etc. need use library js?

i wish this, think green box container list of users in chat

<!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>  $(document).ready(function(){     $("div").mouseenter(function(){         $("div").animate({                     width: '+=100px'         });     });   $("div").mouseout(function(){         $("div").animate({                     width: '-=100px'         });     }); }); </script>  </head> <body> <div style="background:#98bf21;height:100px;width:50px;position:fixed;right:0px;"> user1<br/> user2<br/> user3<br/> user4<br/> </div> </body> </html> 

check http://api.jquery.com/on/

you this:

$("body").on({     click: function() {         //...     }     mouseleave: function() {     //...     },     //other event, etc }, "#yourthing"); 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -