css-backgroundrepeat.js 694 B

12345678910111213141516171819202122232425262728293031
  1. // developer.mozilla.org/en/CSS/background-repeat
  2. // test page: jsbin.com/uzesun/
  3. // http://jsfiddle.net/ryanseddon/yMLTQ/6/
  4. (function(){
  5. function getBgRepeatValue(elem){
  6. return (window.getComputedStyle ?
  7. getComputedStyle(elem, null).getPropertyValue('background') :
  8. elem.currentStyle['background']);
  9. }
  10. Modernizr.testStyles(' #modernizr { background-repeat: round; } ', function(elem, rule){
  11. Modernizr.addTest('bgrepeatround', getBgRepeatValue(elem) == 'round');
  12. });
  13. Modernizr.testStyles(' #modernizr { background-repeat: space; } ', function(elem, rule){
  14. Modernizr.addTest('bgrepeatspace', getBgRepeatValue(elem) == 'space');
  15. });
  16. })();