Dan Eastwell schrieb:
> Thanks chaps, great answers. Is :gt(n) a jQuery or CSS3 pseudo selector?
That's XPath!
-- Klaus
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Klaus Hartl schrieb:
> Dan Eastwell schrieb:
>> Thanks chaps, great answers. Is :gt(n) a jQuery or CSS3 pseudo selector?
>
> That's XPath!
Forget that! It's jQuery, but an equivalent to XPath:
[position() > 2] becomes :gt(2)
-- Klaus
___
jQuery ma
Thanks chaps, great answers. Is :gt(n) a jQuery or CSS3 pseudo selector?
PS Yehuda - The reason is that I'm not striping a table! Good answer nontheless!
On 3/1/07, Yehuda Katz <[EMAIL PROTECTED]> wrote:
> Why do you want to ignore the first two items? A better solution might be to
> use to stor
Why do you want to ignore the first two items? A better solution might be to
use to store header info outside the table and then do $("table
tbody tr:nth-child(odd)")
-- Yehuda
On 2/28/07, Karl Swedberg <[EMAIL PROTECTED]> wrote:
Hi Dan,
jQuery doesn't support the ":nth-child(an + b)", only "
Hi Dan,
jQuery doesn't support the ":nth-child(an + b)", only ":nth-child(n)"
To select every odd item except the first two items, try this instead:
$('#search-results div:nth-child("odd"):gt(0)')
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Feb 28
I see a few problems:
div:nth-child(2) will only select the 2nd child NOT every odd child.
Try the following:
$("#search-results div:nth-child(odd):gt(1)").addClass("stripes");
that should select all your odd child divs except the first two and give
them the class "stripes"
Dan Eastwell wr
Hello,
I'm trying to select every odd item in a list, but not the first two items.
I've tried using the nth-child selector, which is fine at picking out
the nth-child, but I can't get the 2n+2 child to be selected:
stripes("#search-results div:odd"); // is ok
stripes("#search-re