Skip to content

Instantly share code, notes, and snippets.

@ihorduchenko
Created February 17, 2021 11:14
Show Gist options
  • Save ihorduchenko/d6cd6dfaf02b44e1634fd21356b31d19 to your computer and use it in GitHub Desktop.
Save ihorduchenko/d6cd6dfaf02b44e1634fd21356b31d19 to your computer and use it in GitHub Desktop.
Execute scripts, dependent on jQuery, when jQuery load
function loadAllScripts() {
// Put all your scripts here
};
const loadScriptsInterval = setInterval(function() {
if (window.jQuery && window.Swiper) {
// Here we clear interval and fire scripts execution
clearInterval(loadScriptsInterval);
loadAllScripts();
}
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment