在我的画廊中,Div通过循环生成。在那里,我想给小型(单人)Div的悬停效果。在我的代码中,当我将整个div展示的peticular div效果展开时。单个div的jquery悬停功能
mycode的
.spanstyle{opacity:1;}
while (loop){
<div class="waz">
<span class="spanstyle"></span>
</div>
}
$(".waz .spanstyle").each(function(i, val) {
$(this).mouseenter(function() {
$(this).stop().animate({ opacity: 1 }, 300);
})
$(this).mouseleave(function() {
$(this).stop().animate({ opacity: .3 }, 100);
})
});
更多的细节,你可以检查项目: Project
ID必须是唯一!!!!! – Bazzz
编辑的问题,谢谢 – Wazan
你有这个事件附加到spanstyle,而不是waz – karaxuna