Simple jQuery Toggle of children

Posted by Rick on Stack Overflow See other posts from Stack Overflow or by Rick
Published on 2010-03-28T19:17:12Z Indexed on 2010/03/28 19:23 UTC
Read the original article Hit count: 167

Filed under:
|

Um, why no worky? Trying to toggle a ul with this:

 $("#others").children(".btn").click(function(){
    if ($(this).children("ul").is(":hidden"))
    {
   $(this).children("ul").slideDown();
    } else {
   $(this).children("ul").slideUp();
    }
 });

And:

<div id="other">
 <div id="galleries">
  <a href="#" class="btn">Galleries >> </a>
  <ul id="select_gallery">
  ...
  </ul>
 </div>
 <div id="events">
  <a href="#" class="btn">Events >> </a>
  <ul id="select_event">
  ...
  </ul>
 </div>
</div>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors