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 start callback 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

Check some other articles we wrote

Top 10 Most Common WordPress Myths Debunked By Specialists
During some recent discussions with a fellow entrepreneur, the topic somehow turned to TV shows that we both enjoy, and one show that was brought up was MythBusters. There’s nothing like watching a team led by two likable guys use science to debunk some common myths that everybody has heard about. However, that made me think: […]
Replace comment notification email with Mandrill template
Replace comment notification email with Mandrill template
Have you ever needed to replace the default email that WordPress is sending whenever a new comment is added? Recently I did. Here’s how I did it: To get this going you have to: 1) Install and configure WPMandrill plugin 2) Create a new template in your Mandrill account 3) Paste the php code in your […]
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 […]