Home › Forums › Front-end Issues › How to wait until content is loaded before running JS? › Reply To: How to wait until content is loaded before running JS?
Are you useing jQuery? Or does the slider script use jQuery?
Where you need to add the code to wait for the content to load is in the JS that you’r enqueuing. If you’re using jQuery then you’d do something like this.
jQuery(document).ready(function($) {
// your code here
});
edit: of course you’re using jQuery, your script depends on jQuery and I should have seen that in what you posted, excuse the dumb question.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.