Angel Garcia
Posts: 0
Joined: Thu Jun 11, 2015 11:37 am

Animate carousel using JavaScript

I am trying to animate a carousel by coding because native animation not working for me.

Following the guide for Carousel component, I am using this methods to build my function:
https://devcenter.appery.io/documenta...

This function I refer, sliderStart(), is called when page loads, and its code is (carousel is the name of my carousel):

function sliderStart () {
setTimeout(function () { sliderMove(); }, 2500);
}

function sliderMove () {
console.log( Appery('carousel').length );
Appery('carousel').next();
sliderStart();
}

I have tested this with a one-position carousel (data is obtained via custom REST service) and with a three-position carousel whose data I've introduced manually. In both cases length returns me value 0, and next(); doesn't work (I tried with next() and next).

What am I doing wrong?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Animate carousel using JavaScript

Hello Angel,

Could you please clarify do you have any errors or warning in a browser console? Also could you please provide us with more details what issue do you have with native animation method?

Angel Garcia
Posts: 0
Joined: Thu Jun 11, 2015 11:37 am

Animate carousel using JavaScript

Priority support solved me this question. I didn't write functions correctly:

var onDelay = function(){
Apperyio("myCarousel").carouselRoot.carousel("next");

Code: Select all

 }; 

 window.clearInterval(self.carouselTimer); 
 self.carouselTimer = window.setInterval(onDelay, 1000); 

Thanks anyway, Evgene.

Return to “Issues”