On Dec 19, 2008, at 1:11 PM, Ricardo Tomasi wrote:
>
> Is there any reason the pseudo-selectors :odd and :even are zero-
> indexed, returning the opposite of nth-child(odd/even)? That's quite
> counter intuitive.

Yes. The decision was made to standardize on 0 index, since that is  
what JavaScript (and most other programming languages) does. However,  
since :nth-child() is based on the CSS specification, which is 1- 
based, and since there is no native-DOM/JS counterpart, it made sense  
to stick to the spec. This is true for not only :nth-child(odd/even)  
but also :nth-child(n) etc. So, you're right, it is a little  
counterintuitive, but the rationale is sound. I suppose we have the  
w3c to thank for the inconsistency.

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to