css-backgroundposition-shorthand.js 492 B

12345678910111213141516171819
  1. /*
  2. https://developer.mozilla.org/en/CSS/background-position
  3. http://www.w3.org/TR/css3-background/#background-position
  4. Example: http://jsfiddle.net/Blink/bBXvt/
  5. */
  6. (function() {
  7. var elem = document.createElement('a'),
  8. eStyle = elem.style,
  9. val = "right 10px bottom 10px";
  10. Modernizr.addTest('bgpositionshorthand', function(){
  11. eStyle.cssText = "background-position: " + val + ";";
  12. return (eStyle.backgroundPosition === val);
  13. });
  14. }());