-
-
Save parallaxisjones/f6ce80d2ce1a97a857e513748dae07f0 to your computer and use it in GitHub Desktop.
custom event polyfill for IE 11 (>= 9 really)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent | |
;(function() { | |
if (typeof window.CustomEvent === "function") return false | |
function CustomEvent(event, params) { | |
params = params || { bubbles: false, cancelable: false, detail: undefined } | |
var evt = document.createEvent("CustomEvent") | |
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail) | |
return evt | |
} | |
CustomEvent.prototype = window.Event.prototype | |
window.CustomEvent = CustomEvent | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment