New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature detect for nth-child() #685
Changes from 1 commit
d1e9add
3b7f28f
cb03dbf
7a7e4cc
ddff156
4dbe843
616aad4
dfb4cff
c5f2bf0
c9645f1
906bf59
1fe1e83
e103629
4b68b43
122f5be
61c9fac
b61e97d
030ed04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// nth-child pseudo selector | ||
Modernizr.addTest('nthchild', function(){ | ||
|
||
return Modernizr.testStyles("#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}", function (elem) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. single-quotes |
||
var elems = elem.getElementsByTagName("div"), | ||
test = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indent |
||
for (i=0; i<5; i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're leaking the |
||
test = test && elems[i].offsetWidth == i%2+1; | ||
} | ||
return test; | ||
}, 5); | ||
|
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function() {