1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| (function(){ if(typeof window.CustomEvent ==== 'undefined'){ function (event, params){ params = params || { bubbles:false, cancelable:false, detail:undefined }; var evt = document.createEvent('Events'); var bubbles = true; for(var name in params){ name === 'bubbles' ? (bubbles = !!params[name]) : (evt[name] = params[name]); }; evt.initEvent(event, bubbles, true); return evt; }; CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; } })()
if(!window.CustomEvent){ widow.CustomEvent = function(type, config){ config = config || { bubbles:false,cancelable:false,detail:undefined}; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(type, config,bubbles, config.cancelable, config.detail); return evt; } window.CustomEvent.prototype = window.Event.prototype; }
|