Explorar o código

added Get Computed Style fix for IE

eddiemachado %!s(int64=13) %!d(string=hai) anos
pai
achega
dff36afe81
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      library/js/scripts.js

+ 18 - 0
library/js/scripts.js

@@ -9,6 +9,24 @@ slow the page load.
 
 */
 
+// IE8 ployfill for GetComputed Style (for Responsive Script below)
+if (!window.getComputedStyle) {
+    window.getComputedStyle = function(el, pseudo) {
+        this.el = el;
+        this.getPropertyValue = function(prop) {
+            var re = /(\-([a-z]){1})/g;
+            if (prop == 'float') prop = 'styleFloat';
+            if (re.test(prop)) {
+                prop = prop.replace(re, function () {
+                    return arguments[2].toUpperCase();
+                });
+            }
+            return el.currentStyle[prop] ? el.currentStyle[prop] : null;
+        }
+        return this;
+    }
+}
+
 // as the page loads, call these scripts
 jQuery(document).ready(function($) {