dio-v
5/13/2015 - 8:29 AM

Wait untill everything is loaded

Wait untill everything is loaded

var everythingLoaded = setInterval(function() {
  if (/loaded|complete/.test(document.readyState)) {
    clearInterval(everythingLoaded);
    init(); // this is the function that gets called when everything is loaded
  }
}, 10);