var index = 2; // Gallery starts at index 1
var count = 0;
var limit = 3; // number of times gallery must scroll without user interaction
var intervalId = setInterval(function() {
if (index > 4) {
// scroll back to the first image
index = 0;
count++;
}
gallery3d_2.goToFrame(index++, true);
if (count > limit-1) {
// The gallery has already scrolled 2 times (limit) without user interaction.
window.clearInterval(intervalId);
}
}, 1100);
// Clear the timer if the user interacts with the gallery.
gallery3d_2.getElement().addEventListener('touchstart', function() {
window.clearInterval(intervalId);
});
gallery3d_2.getElement().addEventListener('click', function() {
window.clearInterval(intervalId);
});
Hi Carlos ,
You can use a timeline event to create the delay animation so that it does not jump to frame 3 right away, then Add an event rotateOnce to start rotation
Note : If you need to rotate the gallery 3 times then add 3 events with RotateOnce as below (event-1… event-3)