Hover Event in jQuery

 jQuery is very powerful as it says write less and do more....

We can get done our two job in its single hover event. The syntax of hover is as-

hover (parameter1   ,   parameter2)

                       |                          |________  On Mouse Off

                       |___________   On Mouse Over                                                        


 Lets see it in an example. Suppose we want to get  change a button color when mouse is on over. Say button id is 'btnOk' . So below line of code will do this -                                                                        

    $('#btnOk').hover(  function(){ $(this).css('color','blue');  }

                      , function(){ $(this).css('color','green'); }

                      );

 

Note: There are many jQuery articles on CsharpCorner and this blog is just a small seed but it will make interest for using jQuery who are not familiar with it.

Ebook Download
View all
Learn
View all