/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
- // https://github.com/Modernizr/Modernizr/issues/572
- // http://jsfiddle.net/glsee/JDsWQ/4/
- Modernizr.addTest('cssvmaxunit', function(){
- var bool;
- Modernizr.testStyles("#modernizr { width: 50vmax; }", function(elem, rule) {
- var one_vw = window.innerWidth/100,
- one_vh = window.innerHeight/100,
- compWidth = parseInt((window.getComputedStyle ?
- getComputedStyle(elem, null) :
- elem.currentStyle)['width'],10);
- bool = ( parseInt(Math.max(one_vw, one_vh)*50,10) == compWidth );
- });
- return bool;
- });