Added fix for :nth-child(n).
authorJohn Resig <jeresig@gmail.com>
Fri, 29 Jun 2007 21:08:46 +0000 (21:08 +0000)
committerJohn Resig <jeresig@gmail.com>
Fri, 29 Jun 2007 21:08:46 +0000 (21:08 +0000)
src/selector/selector.js

index e6d2d06..94af81e 100644 (file)
@@ -377,7 +377,7 @@ jQuery.extend({
                                        var add = false;
 
                                        if ( first == 1 ) {
-                                               if ( node.nodeIndex == last )
+                                               if ( last == 0 || node.nodeIndex == last )
                                                        add = true;
                                        } else if ( (node.nodeIndex + last) % first == 0 )
                                                add = true;