İon-Slides It stops when you press the back key


#1

Hi I’m using ion-slides with ionic1, AutoPlay works on first boot but does not work when I go to another page and come back.

<ion-slides options="{'loop': true,'autoplay':true, 'effect':flip, 'speed': 500}"  slider="slider1"  style="width:100%;height:200px;">
  <ion-slide-page>
   ........................
 </ion-slide-page>
</ion-slides>

Thanks.


#2

Call $ionicSlideBoxDelegate.update()


#3

Hi,
@zafer4556

if you want autoplay use the below mentioned link. It may help you find the solution.

   <ion-slide-box does-continue="true" slide-interval="1000" on-slide-changed="slideChanged(index)">
         <ion-slide>
             ....................
         </ion-slide>
   </ion-slide-box>

    $scope.slideChanged = function(index) {

       // Check if we should update the left buttons
       if(index > 0) {
         // If this is not the first slide, give it a back button
         $scope.leftButtons = [
           {
             content: 'Back',
             type: 'button-positive button-clear',
             tap: function(e) {
               // Move to the previous slide
               $scope.$broadcast('slideBox.prevSlide');
             }
           }
         ];
       } else {
         // This is the first slide, use the default left buttons
         $scope.leftButtons = leftButtons;
       }
       
       // If this is the last slide, set the right button to
       // move to the app
       if(index == 2) {
         $scope.rightButtons = [
           {
             content: 'Start using MyApp',
             type: 'button-positive button-clear',
             tap: function(e) {
               startApp();
             }
           }
         ];
       } else {
         // Otherwise, use the default buttons
         $scope.rightButtons = rightButtons;
       }
     };
   })

If this solution worked for you then please mark it as a solution and give one like by clicking on heart icon


#4

Unfortunately, I use ion-slides in my project, not ion-slide-box.
Ion-slide-box not working.

This code works on first boot.
It does not work when I go to another page and press it back.


#5

It may help you find the solution.

setInterval(function () {
$ionicSlideBoxDelegate.next();
}, 3000);