javascript - How to select div whith jquery from inside another div -
so have html:
<div> <div> <a class="member-img" href="#" > <img src="image.jpg" alt="member"> </a> </div> <div class="member-bar"> </div> </div>
and try select "member-bar" when user hovers "member-img"
$('.member-img').hover(function(){ $(this).closest(".member-bar").slidedown() });
but doesn't seem work, code ?
member-bar
need parent of member-img
in order work. need first find parent, find member-bar
sibling:
$(".member-img").hover(function() { $(this).parent().next(".member-bar").slidedown(); });
here's fiddle above code
Comments
Post a Comment