Posted By

conspirator on 05/19/09


Tagged

jquery split ul li davidlink


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

cmahoney
typomatic


jquery split ul into two


 / Published in: jQuery
 

@davidlink aim: instanteggrolls

  1. $(document).ready(function(){
  2. $('.splitcol').each(function(i){
  3. var colsize = Math.round($(this).find("li").size() / 2);
  4. $(this).find("li").each(function(i) {
  5. if (i>=colsize){
  6. $(this).addClass('splitcol_right');
  7. }
  8. }
  9. )
  10. $(this).find('.splitcol_right').insertAfter(this).wrapAll("<ul class='left'></ul>");
  11. }
  12. )
  13. });

Report this snippet  

You need to login to post a comment.