/AppLanding/js/vendor/modernizr/feature-detects/css-vmaxunit.js

https://gitlab.com/webocalypse/themes · JavaScript · 14 lines · 12 code · 0 blank · 2 comment · 1 complexity · 0a6e5e3491c98573ef67faf341f5b2ce MD5 · raw file

  1. // https://github.com/Modernizr/Modernizr/issues/572
  2. // http://jsfiddle.net/glsee/JDsWQ/4/
  3. Modernizr.addTest('cssvmaxunit', function(){
  4. var bool;
  5. Modernizr.testStyles("#modernizr { width: 50vmax; }", function(elem, rule) {
  6. var one_vw = window.innerWidth/100,
  7. one_vh = window.innerHeight/100,
  8. compWidth = parseInt((window.getComputedStyle ?
  9. getComputedStyle(elem, null) :
  10. elem.currentStyle)['width'],10);
  11. bool = ( parseInt(Math.max(one_vw, one_vh)*50,10) == compWidth );
  12. });
  13. return bool;
  14. });