Schedule a Free Consultation
Test If Flexslider Loaded

Test If Flexslider Loaded

Read Article

Recently I had a mini project for a client and I had to test if Flexslider has been shown on the screen in order to further modify it. Subscribing to the startcallback didn’t work because the slider was shown by the theme and not by my code.

jQuery(document).ready(…) didn’t work either. The slider was there, but I couldn’t subscribe to click events on the arrows of the slider.

So I decided to go for a chained setTimeout sequence. I used it for Flexslider, but it can be used whenever you need to check that some things happened on the page and you really don’t have other (easy) alternatives.

Here’s how it looks like and it works:

Later edit:
Another approach would have been to use setInterval / clearInterval JavaScript functions. Next time.

Navigate to

You Might Also Enjoy These Digital Marketing Articles:

How to Choose a WordPress Expert for Your Website - WPRiders Article
How to Choose a WordPress Expert for Your Website
While WordPress is a user-friendly platform for creating simple websites, things can quickly become complex when starting a business website. Custom functionalities, complicated platform integrations, cybersecurity, compliance, and optimizations are all critical factors you must consider. A WordPress expert can provide expert guidance, support, and services to help businesses navigate these complexities and create a […]
WordPress Security in Focus: Building Trust With Your Customers
With over 43% of all websites powered by WordPress as of August 2023, it’s no wonder this CMS dominates with over 60% of the global market share. Its popularity and open-source system make it the go-to choice for many businesses and organizations. However, these same reasons also make WordPress a lucrative target for hackers looking […]
What’s Included in a Comprehensive WordPress Maintenance Plan? WPRiders Article
What’s Included in a Comprehensive WordPress Maintenance Plan?
If you’re running a WordPress website, one of the smartest decisions you can make is investing in a comprehensive WordPress maintenance plan. Too often, business owners assume their website will just keep running smoothly on its own — but the truth is, regular maintenance is essential to keeping your site secure, fast, and problem-free. At […]