1
的DIV當你將鼠標懸停在My
文字myicon.png
淡出,然後回來:如何獲得前最接近的一個
<div class="mmItemStyleChild">
<img src="theImages/myicon.png" class="mIcon vertAlign mmm1" id="mMW1" /> <img src="theImages/emptyImg.png" class="mSpacerStyle" /><span id="mMW" class="vertAlign mmm">My</span>
</div>
$('.mmm').hover(function() {
$(this).closest('div').find('img').first().stop().animate({ 'opacity': .35 });
}, function() {
$(this).closest('div').find('img').first().stop().animate({ 'opacity': 1 });
});
我是想爲以下做同樣的,但它不是工作:
<div class="mBtnMidS mBtnMidStyle">
<div>
<img id="mbS1" src="theImages/services_icon.png" class="mBtnIcon" />
</div>
<div>
<span id="mbS" class="mbBtnText">Services</span>
</div>
</div>
$('.mbBtnText').hover(function() {
$(this).closest('div').find('img').first().stop().animate({ 'opacity': .55 });
}, function() {
$(this).closest('div').find('img').first().stop().animate({ 'opacity': 1 });
});
如何修改上面的代碼,以便它從父DIV看起來(使用類的mBtnMidS`或‘mBtnMidStyle’),並獲取影像並進行了同樣的動畫漸變作爲第一個腳本
謝謝。那就是訣竅。 – SearchForKnowledge 2014-10-20 16:55:08