Skip to content

Instantly share code, notes, and snippets.

@Jayphen
Created March 28, 2011 02:23
Show Gist options
  • Save Jayphen/889896 to your computer and use it in GitHub Desktop.
Save Jayphen/889896 to your computer and use it in GitHub Desktop.
Extend modernizr to check if minwidth is supported or not
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