2011-08-09 17 views

回答

2

懸停內/輸入功能:$(本).siblings()淡出()

例如:

$('.the-divs').mouseenter(function() { 
    $(this).siblings().fadeOut(); // or whatever animation, eventually with delay() 
}); 
0

你需要定位的div,這樣當別人淡出剩下的div不動,在我的例子中,我將div設置爲絕對定位。

example

var $threeDivs = $('#container > div'); 

$threeDivs.hover(function() { // mouseover 
    $(this).siblings().stop(true, true).fadeOut(); 
}, function() { // mouseout 
    $(this).siblings().stop(true, true).fadeIn(); 
}); 
相關問題