Open mcasimir opened 9 years ago
I think you forgot $document
(should be document
) and you don't seem to be using getElemComputedStyle
. Anyway, I couldn't get this to work with IE10 (e.target
seems to be read-only) and gave up.
You're right $document
should be document
in fact. I do this to 'getElemComputedStyle':
// Cross browser `window.getComputedStyle`, taken from jquery .css() source
var getElemComputedStyle = function(elem) {
if ( elem.ownerDocument.defaultView.opener ) {
return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
}
return window.getComputedStyle( elem, null );
};
I've not tested the entire polyfill I just tested small pieces of it. I think it should work against IE10. What I've done is create a small script detecting wether to use the polyfill or not without jQuery and appending the result to document.body
.
Then I tested it against IE 10 with BrowserStack and it worked. The only failing tests were with Opera, that, like it should be, does not return unsupported properties with getComputedStyle
.
Also note that this code could/should be extended to support pseudo-elements too.
Anyway in my opinion it's very strange to me that those interaction properties are made available through style API without a proper DOM API counterpart, silencing events for an element is such a common use case.
Hi, i was attempting to use your polyfill for Mobile Angular UI so I re-adapted it to be used without jquery. Dropped the idea since I think nothing could be done for Opera, at least not with a lightweight solution. Never tested, but should be correct and should work.