Created
February 17, 2021 11:14
-
-
Save ihorduchenko/d6cd6dfaf02b44e1634fd21356b31d19 to your computer and use it in GitHub Desktop.
Execute scripts, dependent on jQuery, when jQuery load
This file contains hidden or 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
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