[jQuery] Re: HELP!!! css content filters

2009-10-17 Thread huntspointer2009
Thanks (Bi Jing), You offered the best solution, I tried using all of the code that was offered, but the following code was the only one that it made it work: $(li:even:odd, li:odd:odd).addClass(test_css); I also like the fact that it's a minimal amount code, written in one line. Thanks to

[jQuery] Re: HELP!!! css content filters

2009-10-16 Thread Evgeny Bobovik
try to use this function script function test(){ var ind = 0; $('ul').find('li').each(function(){ if (ind == 2){ $(this).css('test_css'); ind = 0; }else{ ind++; } }); } /script Gk___ Sent from Minsk, Belarus 2009/10/16 huntspointer2009

[jQuery] Re: HELP!!! css content filters

2009-10-16 Thread Liam Byrne
You have an unnecessary n in your code. var test_css = {'background':'#000'}; $(ul li:nth-child(3n)).css(test_css); should be $(ul li:nth-child(3)).css(test_css); Liam huntspointer2009 wrote: - Can someone please help me solve the following issue? - How can I select and apply a

[jQuery] Re: HELP!!! css content filters

2009-10-16 Thread Bi Jing
Please try this $(ul li).each(function(i){this.addClass(['','','test_css','test_css'][i%4])}) OR..you can try to use another one: $(li:even:odd, li:odd:odd).addClass(test_css); On Fri, Oct 16, 2009 at 3:07 PM, Evgeny Bobovik bobo...@gmail.com wrote: try to use this function script