Ninja Slider / Posts /

How to detect if the image slider is fully loaded after the page loads

I need to call the built-in functions of the Ninja image slider after the page loads. How can I detect if the image slider has been fully loaded and be available for calling its built-in functions?
Ali  5 years ago   viewed: 2626    

1 Answer


You can verify its availability by checking: if (typeof nslider != "undefined" && typeof nslider.getSlides() != "undefined"){...}

Please check out its example in the post:

<script type="text/javascript"> function switchSlide() { if (typeof nslider != "undefined" && typeof nslider.getSlides() != "undefined") { // It is ready now. You can call the slider's built-in functions ...... } else { setTimeout(switchSlide, 10); } } </script>
Milo   5 years ago


Your name*
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: