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:

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: Let me know if it worked for you.
Filter Custom Posts by Author in WP-Admin - WPRiders Article
Filter Custom Posts by Author in WP-Admin
Need to filter your Custom Post Types in WordPress by Author in WPAdmin? Here’s a handy way to do it by adding a new drop down for filtering: And here’s how it looks like:
Add html Comments Using Newly Created User Role - WPRiders Article
Add html Comments Using Newly Created User Role
I was recently working on a piece of code that needed to do the following: Everything worked perfectly when I tested it using an admin account. The comment included HTML content like images and links and displayed exactly as expected. However, when I switched to the new user role and tried the same thing, WordPress […]