Like .click(), the params are normally other functions. .hover() is pretty much the same as mouseover() however… .hover() can have it’s ‘re-set’ function in the same block of code, whereas .mouseover() needs .mouseout() to reset it….
So in a nutshell, .hover() is much cleaner…. See examples at Jquery. An example of setting and resetting in a .hover() is as follows… Basically, the principle is to declare what you want it to do when hovered over, then after a comma, what you want it to reset to…
.hover(first-change(),reset());
example below:
$('h4').hover( function(){ $(this).css("background", "#000000"); }, // notice the comma here! function(){ $(this).css("background", "#eeeeee"); } );
Main Category