css-lastchild.js 340 B

1234567891011
  1. // last-child pseudo selector
  2. // https://github.com/Modernizr/Modernizr/pull/304
  3. Modernizr.addTest('lastchild', function(){
  4. return Modernizr.testStyles("#modernizr div {width:100px} #modernizr :last-child{width:200px;display:block}", function (elem) {
  5. return elem.lastChild.offsetWidth > elem.firstChild.offsetWidth;
  6. }, 2);
  7. });