Posted By

davebowker on 08/28/10


Tagged

jquery collapse expand


Versions (?)

Manual if gt than hide, then expand collapse


 / Published in: jQuery
 

Use Collapsorz

  1. $('.ukn-tags-related-inline ol.ukn-style-1 li:gt(4)').hide();
  2. $('.ukn-tags-related-inline ol.ukn-style-1').append('<li><a class="ukn-toggler ukn-j-tipsy" title="Show more tags" href="#"><span>+</span></a></li>');
  3. $('.ukn-tags-related-inline ol.ukn-style-1 li a.ukn-toggler').toggle(function(e) {
  4. e.preventDefault();
  5. $(this).attr('title', 'Show less tags').html('<span>-</span>').parent().parent().addClass('ukn-active');
  6. $('.ukn-tags-related-inline ol.ukn-style-1 li:gt(4)').show();
  7. }, function() {
  8. $(this).attr('title', 'Show more tags').html('<span>+</span>').parent().parent().removeClass('ukn-active');
  9. $('.ukn-tags-related-inline ol.ukn-style-1 li:gt(4):not(:last)').hide();
  10. });

Report this snippet  

You need to login to post a comment.