Posted By

davebowker on 04/09/09


Tagged

jquery loop child each Parent


Versions (?)

jQuery loop and hide on child elements of multiple parents


 / Published in: JavaScript
 

  1. var counter;
  2. $("#ukn-clusters ul.ukn-component-main li ul").each(function() {
  3. counter = 1;
  4. $(this).children("li").each(function() {
  5. if (counter > 3) $(this).addClass('ukn-cluster-hidden').hide()
  6. counter++;
  7. });
  8. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: davebowker on April 14, 2009

$('.ukn-expand').click(function(){ $(this).toggleClass('ukn-collapse'); $(this).next().children().next('li.ukn-cluster-extras').toggle(400); return false; });

(Expand results after they've been collapsed)

Code unused due to the finding of collapsorz jquery plugin (http://jquery.kuzemchak.net/collapsorz.php)

You need to login to post a comment.