iron-swipeable-pages icon indicating copy to clipboard operation
iron-swipeable-pages copied to clipboard

FEATURE REQUEST: Add automatic swipes (carousel) ?

Open oneezy opened this issue 9 years ago • 2 comments

FEATURE REQUEST: Add automatic swipes (carousel) ?

oneezy avatar Jul 25 '16 21:07 oneezy

do you mean have a timer that fires swipes periodically? the element already inherits selectNext() and selectPrevious() from IronSelectableBehavior so you can just call those from a timer function. One caveat is it will animate the wrap-around transition the wrong way, it will animate all the pages sliding back to the first page like a stack instead of sliding directly to the first page like a proper carousel. I hacked in a kludge to make it animate properly on a 3 element list but you'll need to improve it to make it work with more than 3 elements https://github.com/n1ywb/iron-swipeable-pages/commit/cef18dad5c5ed91340edca0d905659cdf2a2f049

n1ywb avatar Dec 02 '16 13:12 n1ywb

yeah, ideally we could expose the functionality through the API. Something like this,

<iron-swipeable-pages
    timer="3s"
    loop="true"
</iron-swipeable-pages>

oneezy avatar Dec 03 '16 09:12 oneezy