how to make carousel auto play?

Topic: how to make carousel auto play?

jadoon saleem premium asked a week ago

how to make carousel auto play?

I have form that contain number of carousel (number is not constant), how to make them all autoplay ?


Arkadiusz Idzikowski staff commented a week ago

@jadoon saleem Can you provide more information about the problem? Our carousel should have autoplay enabled by default if you used examples from our documentation without any modification:

jadoon saleem premium commented a week ago

hi @Arkadiusz Idzikowski , it is not work for me , autoplay doesn't work by default , I had to add the following code to make this work: I had to add this code:

public host : String; @ViewChild('carouselRef', { static: false }) private carouselRef: CarouselComponent; setTimeout(() => { if ( this.stores[0].imagesPath && this.stores[0].imagesPath.length > 0) { this.carouselRef.nextSlide(); } }, 4000);

but the following solution is good for one carousel , but on my situation I have dynamic number of carousel . I using angular 8 , maybe should to update the version of the angular ? and there a way to do that for all carousel by JS code?


Arkadiusz Idzikowski staff commented a week ago

@jadoon saleem Please update your first post and add an example HTML/TS so we can reproduce this problem on our end.

Please insert min. 20 characters.


Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 11.0.0
  • Device: all
  • Browser: all
  • OS: all
  • Provided sample code: No
  • Provided link: No