-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathondomready.min.js
2 lines (2 loc) · 943 Bytes
/
ondomready.min.js
1
2
/*! onDomReady.js 1.4.0 (c) 2013 Tubal Martin - MIT license */
;(function(a){"function"==typeof define&&define.amd?define(a):window['onDomReady']=a()}(function(){"use strict";function s(a){if(!q){if(!b.body)return v(s);for(q=!0;a=r.shift();)v(a)}}function t(a){(o||a.type===d||b[h]===g)&&(u(),s())}function u(){o?(b[n](l,t,e),a[n](d,t,e)):(b[j](m,t),a[j](f,t))}function v(a,b){setTimeout(a,+b>=0?b:1)}function x(a){q?v(a):r.push(a)}var a=window,b=a.document,c=b.documentElement,d="load",e=!1,f="on"+d,g="complete",h="readyState",i="attachEvent",j="detachEvent",k="addEventListener",l="DOMContentLoaded",m="onreadystatechange",n="removeEventListener",o=k in b,p=e,q=e,r=[];if(b[h]===g)v(s);else if(o)b[k](l,t,e),a[k](d,t,e);else{b[i](m,t),a[i](f,t);try{p=null==a.frameElement&&c}catch(w){}p&&p.doScroll&&function y(){if(!q){try{p.doScroll("left")}catch(a){return v(y,50)}u(),s()}}()}return x.version="1.4.0",x.isReady=function(){return q},x}));