This project is archived and is in readonly mode.

#882 ✓resolved
happy123

nth-child (n+x) bug

Reported by happy123 | April 17th, 2010 @ 04:58 PM | in 1.3.0 rc2 (closed)

Hi

i expect that nth-child(n+2) skip the first child. but script always return all childs. the same is with (n+X) where x is any number.

and there are other bug as i see

if b > a then first result is wrong

3n+4 - results - 1,4,7... WHY 1 ??
2n+4 - results - 2,4,6... WHY 2 ??

examle

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script src="mootools-1.2.4-core.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('domready', function() {
    tabs = $$('#list li:nth-child(n+2)').get('id'); 
    tabs.each(function(e){
        alert(e);
    });
});
</script>


<ul id="list">
    <li id="first">First</li>
    <li id="second">Second</li>
    <li id="third">Third</li>
</ul>


Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Tags

Pages