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:

Practical Gruntfile to Automate Project Related Tasks
Productivity! Oh, yes! The ever-elusive goal of a software developer. No matter how much one tries, trivial tasks will aGrunt is a popular tool that assists developers to automate code management actions, but practical applications of this tool are still elusive. In this article, we share our take on using Grunt to process CSS and […]
What Can You Build With WordPress?
In today’s world, having a business and no website is like trying to drive a car with no engine. Sure, you can reach your destination if you get out and push your car, but wouldn’t it be a lot easier if you just had the engine in the first place? We can say the same […]
How to Choose a WordPress Management Agency
Building a successful online business on WordPress takes effort, time, focus, and flexibility. But if you take your business seriously, I recommend a WordPress management agency that will take care of your website while you focus your efforts on growing the business. WordPress Management Agencies take care of maintenance, backups, cybersecurity, changes, and monthly WordPress […]