From 8f353f15b69c3d3bba9f30e1631dd2e1ccf8e3b5 Mon Sep 17 00:00:00 2001 From: nobuti Date: Wed, 19 Aug 2015 19:19:06 +0200 Subject: [PATCH] Patch IE9 and below. --- index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/index.js b/index.js index 42952da..42f7e39 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,20 @@ +// Patch IE9 and below +try { + document.createElement('DIV').style.setProperty('opacity', 0, ''); +} catch (error) { + CSSStyleDeclaration.prototype.getProperty = function(a) { + return this.getAttribute(a); + }; + + CSSStyleDeclaration.prototype.setProperty = function(a,b) { + return this.setAttribute(a, b + ''); + }; + + CSSStyleDeclaration.prototype.removeProperty = function(a) { + return this.removeAttribute(a); + }; +} + /** * Module Dependencies. */ @@ -16,6 +33,7 @@ var translate = has3d ? ['translate3d(', ', 0)'] : ['translate(', ')']; + /** * Export `Move` */