in my gallery, Div’s generating through a loop. There I want to give a hover effect for a particular (single) Div. In my code when I hover the particular div effects show to whole divs.
my code
.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);
})
});
for more detail, you can check the project :
Project
try this one and check this fiddle might help you