Skip to content

Commit

Permalink
Fix indent, single-quotes and leaking i
Browse files Browse the repository at this point in the history
  • Loading branch information
emilchristensen committed Sep 7, 2012
1 parent d1e9add commit 3b7f28f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions feature-detects/css-nthchild.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// nth-child pseudo selector
Modernizr.addTest('nthchild', function(){

return Modernizr.testStyles("#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}", function (elem) {
var elems = elem.getElementsByTagName("div"),
test = true;
for (i=0; i<5; i++) {
test = test && elems[i].offsetWidth == i%2+1;
}
return test;
}, 5);
return Modernizr.testStyles('#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}', function (elem) {
var elems = elem.getElementsByTagName('div'),
test = true;

});
for (var i=0; i<5; i++) {
test = test && elems[i].offsetWidth == i%2+1;
}

return test;
}, 5);

});

0 comments on commit 3b7f28f

Please sign in to comment.