9bitStudios/flexisel

Scrolling through the carousel

Closed this issue · 9 comments

As stated above, when I scroll the carousel, it scrolls one item at a time until the end. Is there anyway when I scroll the carousel, it scrolls three items at a time?

Example:

Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 in the carousel

First three:-
Item 1 Item 2 Item 3

After clicking the next arrow button

Item 4 Item 5 Item 6

Thanks in advance.

Hi connman...As of right now, only one item per scroll is supported. A multiplier effect could be added to the itemsWidth variable in the animate functions inside of the scrollLeft and scrollRight functions in the plugin, but I don't believe that all of the cloned items for the infinite scoll effect will be present on either side of the scroll if you scroll by too many items at a time

Sweet! Tested, it works! Thanks a lot! =D

Great. Glad it is working out for you.

Can you explain a little more precisely exactly where you need to make changes to be able to scroll through display four items

Well, inside the scrollLeft and scrollRight functions in the plugin there's a place where the current widths of the items are calculated...1 item, the width of how much to scroll by.

itemsWidth = (innerWidth) / itemsVisible;

So after this you'd want to do something like

itemsWidth = itemsWidth * 4;

to change the multiplier to scroll by 4 items.

After this though you'd also have to append more items to the front of the back of the list of items after the scroll animation is complete if you wanted to keep the infinite scroll effect.

At the end of the day though, this behavior is not really supported in this plugin. I do know that what you are looking for is supported in other carousel plugins like FlexSlider or Slick

itemsWidth = itemsWidth * 4;
If you observe closely, it shows that it is sliding 4 items, but the result is one slide.
Observe closely, even though it animates as 4 it only slides 1 item per click.

I'll have to take a deeper look at this when I get a chance, but I'll take you're word for it that you're probably correct. Because the slider was not really designed for this from the outset, truly supporting this behavior properly would require a fairly substantial refactor of some of the code.

It'll be grateful if you could post an update when done.

Please note that this is now supported with the release of version 2.0.0.