summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/css-vmaxunit.js
diff options
context:
space:
mode:
authorLars Henrik Mai <lars.mai@kontinui.de>2014-09-21 12:25:47 +0200
committerLars Henrik Mai <lars.mai@kontinui.de>2014-09-21 12:25:47 +0200
commit7cc7910df63d19e7ebc67bb1156437f0559712d7 (patch)
tree66f972354559fe05b7a97efccd08fc363c91cf4d /source/bower_components/modernizr/feature-detects/css-vmaxunit.js
parent450a01136a510adc4c96ff12e05e00a2ce550c8f (diff)
add foundation via bower
Diffstat (limited to 'source/bower_components/modernizr/feature-detects/css-vmaxunit.js')
-rw-r--r--source/bower_components/modernizr/feature-detects/css-vmaxunit.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/bower_components/modernizr/feature-detects/css-vmaxunit.js b/source/bower_components/modernizr/feature-detects/css-vmaxunit.js
new file mode 100644
index 0000000..142346b
--- /dev/null
+++ b/source/bower_components/modernizr/feature-detects/css-vmaxunit.js
@@ -0,0 +1,14 @@
+// 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;
+}); \ No newline at end of file