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