Skip to content

Commit

Permalink
Positioning #modernizr absolutely to enable more precise offsetLeft c…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
tnajdek committed May 19, 2013
1 parent ec10861 commit 6757ec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feature-detects/css/checked.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
!*/
define(['Modernizr', 'createElement', 'testStyles'], function( Modernizr, createElement, testStyles ) {
Modernizr.addTest('checked', function(){
return testStyles('#modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}', function(elem, rule){
return testStyles('#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}', function(elem, rule){
var cb = createElement('input');
cb.setAttribute("type", "checkbox");
cb.setAttribute("checked", "checked");
elem.appendChild(cb);
return cb.offsetLeft >= 20;
return cb.offsetLeft === 20;
});
});
});

0 comments on commit 6757ec4

Please sign in to comment.