Dynamic Content and Autoplay

mail's Avatar


14 Oct, 2016 01:26 PM


I want to use the slider in an angular/ ajax app. And I encountered a problem when switching all slides dynamically while Autoplay is enabled sometimes it throws a TypeError: Cannot read property 'isLoaded' of undefined.
If I turn autoplay off everythings works fine.

My Programflow is the following:

Create slides array with html and angular directives
then destroy slider if exists
then initialize slider with new slides

  function initSlider(){
                slider = $("#result-list-slider").royalSlider({
                    keyboardNavEnabled: true,
                    autoPlay: {
                        enabled: true,

function destroySlider(){
                slider = undefined;

  1. Support Staff 1 Posted by Dmitry Semenov on 14 Oct, 2016 05:49 PM

    Dmitry Semenov's Avatar


    Are you sure that slider is defined when you call destroySlider method. The plugin clears autoplay timeouts on destroy, very strange, try also calling stopAutoPlay method before the destroy.


  2. 2 Posted by mail on 17 Oct, 2016 06:50 AM

    mail's Avatar

    Thanks for fast reply I think I found the reason it happens when slides array is empty. Tough it doesn't throw errors when autoplay.enabled = false;

  3. mail closed this discussion on 17 Oct, 2016 08:47 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac