Created
March 28, 2011 02:23
-
-
Save Jayphen/889896 to your computer and use it in GitHub Desktop.
Extend modernizr to check if minwidth is supported or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modernizr.addTest('minwidth', function() { | |
var test = document.createElement('div'), | |
root = document.documentElement.appendChild(document.createElement('body')); | |
test.style.cssText = 'min-width:22px;padding:0;margin:0;position:absolute;top:0;left:0'; | |
root.appendChild(test); | |
var ret = test.offsetWidth === 22; | |
root.removeChild(test); | |
document.documentElement.removeChild(root); | |
return ret; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment