SlideBox as carousel


#1

Is there an API for SlideBox so you can set it to automatically scroll to next slide every n milliseconds?


#2

Just noticed slideBox has 'doesContinue’
which looks like sets ‘continuous’

What is this for?


#3

ionic.views.Slider has this:

// setup auto slideshow
var delay = options.auto || 0;
var interval;

function begin() {
  interval = setTimeout(next, delay);
}

how do you set options.auto?


#4

Done a bit of hacking and this seems to be doing the trick

ionic-angular.js

    scope: {
      doesContinue: '@',
      auto: '@',
      showPager: '@',
      onSlideChanged: '&'
    },
...
        auto: $scope.$eval($scope.auto) || 0,
        continuous: $scope.$eval($scope.doesContinue) === true,

html

<slide-box show-pager="true" does-continue="true" auto="5000">

#5

Hey @ajmercer, sorry for the delay. I’ll get this into the repo, thanks much!


#6

cool - thanks @max

Next thing to add would be ‘tap’ to stop


#7

Cool, this is in master now. How would you envision the tap to stop working? Do you have any examples? Would it be a “hold” to stop?


#8

with the new sliderBox, I just downloaded, it seems a manual flick stops the auto scroll (iPhone 5)