On Mar 17, 2:57 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> OK, start by using the latest version, OK?

D'oh! Google has failed me!

Both questions answered.


On Mar 17, 3:31 am, Trevan Richins <[EMAIL PROTECTED]> wrote:
> (position-b)/a >= n (only if (position-b)/a is an integer - no fractions)

I'd started with this approach, but abandoned it because it seemed
more complex than what I'd come up with. But it also has the upside of
being, y'know, *correct*, so I've gone back to it. Thanks!

> So, for your examples:
>
> (n-2) would select all elements because (n-2) => (position+2) which is
>  >= 0 for all positions
>
> (3n-2) would select elements 1,4,7,10 because (3n-2) => (position+2)/3
> Another way to look at this is to say, create groups of three and grab
> the element at -2 (or 1 as 3-2 = 1)
>
> This site might be useful:http://gallery.theopalgroup.com/selectoracle/

I'd found that site as well, but it seems to get stuff wrong. If I ask
it to explain "ul>li:nth-child(n+2)," it replies with:

> Selects any li element *that is a first child* *that is a child of* an ul 
> element.

But that's incorrect. It's saying that only element 1 would be
returned out of a ten-element set, but in truth it'd be the exact
opposite (elements 2-10). That's because no valid value of N (any
integer >= 0) will cause that expression to return the integer 1. So
that site just ended up confusing me even more. :)

At any rate, your examples are correct.  Here's the new logic:
http://pastie.caboo.se/47618

Cheers,
Andrew


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to