Marius Vetrici
CEO wpriders
March 24, 2015

Test if Flexslider loaded

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.

Entrepreneurs usually struggle to create their online platforms when they don’t have a technical partner. It’s confusing and overwhelming.
We have a 5-step process that makes it easy and helps them avoid all the traps. In just 60 days, your web platform is set up and they can start making money.
Send us your project idea and get a free 5-minute review.
Want a beautiful and effective website?

Leave a reply

Your email address will not be published.

Your email address will not be published. Required fields are marked *

Want More Amazing Stories?
Sign up now and get the best business as well as technical advice on how to run your WordPress powered business:
  • This field is for validation purposes and should be left unchanged.