Thread: Resolved Jquery nth term append
View Single Post
Old 11-14-2012, 11:17 AM   PM User | #4
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,452
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by CHEWX View Post
Ok, regardless of the illegal ID use. This wouldn't work then ?

As I would be using #main :nth-child(2n) which would then select every second template within, which I don't want. I want it to select every second of a certain class (or in my case ID).
Code:
#article-inspir:nth-child(2n)
hits both
Code:
<article id=​"article-inspir" class=​"drop-shadow curved curved-hz-1">

i will say however, that you shouldn't actually need to use scripts for this.
simply use CSS to add clear:both to the same selector, or use :after content if you really need to inject a styled block.



in general with these sort of problems, just try out different permutations in the firebug or dev tools console until you hit the tags you want.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.8% IE9:11.4% IE10:6.5%
rnd me is offline   Reply With Quote