Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#9882 closed bug (duplicate)

:nth-child(an+b)

Reported by: StefanoVollono Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

The bug is on Safari and Chrome. The selector :nth-child(an+b) when combined ONLY with multiple selections, for example:

$("#element:nth-child(an+b) , #element2:nth-child(an+b)")

does not appear to be working properly.


EXAMPLE

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() {

$("ul#firstlist li:nth-child(3n+3),ul#secondlist li:nth-child(3n+3)").each(function(){

$(this).css("color","red");

});

});

</script> </head> <body> <p><strong>First List</strong></p> <ul id="firstlist">

<li>uuuuuuuuu</li>

<li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li> <li>uuuuuuuuu</li>

</ul>

<p><strong>Second List</strong></p> <ul id="secondlist">

<li>aaaaaaaaaaaaaaaaa</li>

<li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li> <li>aaaaaaaaaaaaaaaaa</li>

</ul> </body> </html>

Change History (2)

comment:1 Changed 8 years ago by ajpiano

Resolution: duplicate
Status: newclosed

comment:2 Changed 8 years ago by ajpiano

Duplicate of #5664.

Note: See TracTickets for help on using tickets.