[jQuery] Re: every nth element - photo grid arranging

2008-03-07 Thread jason
Here's one way: $(function(){ newRowAt = 5; inc = newRowAt - 1; $('li').each(function(i){ if(newRowAt == i + 1){ $(this).css('clear','left'); newRowAt += inc; } }); }); - jason On M

[jQuery] Re: every nth element - photo grid arranging

2008-03-07 Thread Shelane
I did this: $('ul li:nth-child(5n)').css("clear","both"); It's still having a strange output: http://education.llnl.gov/sme/photos.lasso On Mar 7, 1:33 pm, Shelane <[EMAIL PROTECTED]> wrote: > I basically want to create a grid of items from a list. For example I > want a new row after every 4t