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

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -