MicroTut: The jQuery Hover Method

Go Back To The Tutorial »

Hover Me
$('.selectorClass').hover(
function(){
	$(this).stop().fadeTo('slow',0.4);
},
function(){
	$(this).stop().fadeTo('slow',1);
});
Hover Me
$('.selectorClass2').mouseenter(function(){
	$(this).stop().fadeTo('slow',0.4);
}).mouseleave(function(){
	$(this).stop().fadeTo('slow',1);
});
Hover Me
$('.selectorClass3').hover(function(){
	this.check = this.check || 1;
	$(this).stop().fadeTo('slow',
    this.check++%2==0 ? 1 : 0.4);
});