AnythingSlider icon indicating copy to clipboard operation
AnythingSlider copied to clipboard

Inifinite slides with change by multiple?

Open bghouse opened this issue 13 years ago • 6 comments

I'm trying to be a carousel to display manufacturer logos. I've set these options:

showMultiple : 4 changeBy: 4 infiniteSlides: true

It is not wrapping. When it hits the end, it's rewinding instead of wrapping.

I can see in Firebug that it is cloning panels.

If I put the changeBy back to 1 - it wraps properly. But any number greater than 1 stops the wrapping from happening.

You can see on my testing site at fsbdev.xigko.com

Is this a limitation in the code?

bghouse avatar Dec 11 '12 17:12 bghouse

Hi bghouse!

Yeah it's an issue with the code. The reason is wraps is because when any number greater than one is added to the last slide number, it resets it back to one. So instead of wrapping it rewinds.

I'll try to look at the code soon and see if I can fix it.

Mottie avatar Dec 13 '12 14:12 Mottie

Thanks, that would be super!

bghouse avatar Dec 13 '12 21:12 bghouse

Hi Mottie, Any update on this issue?

bghouse avatar Jan 16 '13 22:01 bghouse

Oh sorry, I haven't had time to look into this yet =(.

I'm looking at it now and it won't be a simple fix. I might end up cloning more slides and adding them to the beginning. Or, completely changing how AnythingSlider handles switching between panels. It'll take some time to figure it out. Honestly, because of my limited time lately, maybe you should check out jCarousel (circular carousel).

Mottie avatar Jan 16 '13 23:01 Mottie

No worries, I currently just have it advancing by 1. Since I'm already using another instance of Anything slider on the page, I'd hate to have to integrate yet another jquery script, so I just stick with the single advance for now. Thanks!

bghouse avatar Jan 17 '13 02:01 bghouse

So, I put on my thinking cap for this... and I'm not sure I like where it is heading.

If you can understand my crappy diagram below, you'll see than in order to have 4 panels, set with showMultiple: 4 and changeBy: 4, the slider would have to make 7 duplicate slides! This would only get bigger with more slides.

So 4a is a duplicate of slide 4, positioned on the left. Slides 1b-4b are duplicates of the original 4 slides, and slides 1c-2c are another set of duplicates of just the first two slides. The "diagrams" below show what needs to be done when animating to the right or left.

======================================
 Panels 4, changeBy 4, showMultiple 4
======================================

  |4a| 1| 2| 3| 4|1b|2b|3b|4b|1c|2c|

   GO RIGHT

     |_1|__|__|_4| -> animate right
                 |1b|__|__|4b| now reset to start
     |_1|__|__|_4|                <---|

        |_2|__|__|1b| -> animate right
                    |2b|__|__|1c| now reset to start
        |_2|__|__|1b|                <---|

           |_3|__|__|2b| -> animate right
                       |3b|__|__|2c| now reset to start
           |_3|__|__|2b|                <---|

              |_4|__|__|3b| -> reset position before animation
  |4a|__|__|_3| -> animate right
              |_4|__|__|3b|

  |4a| 1| 2| 3| 4|1b|2b|3b|4b|1c|2c|

   GO LEFT

     |_1|__|__|_4| - reset position before animation
                 |1b|__|__|4b| <- animate left
     |_1|__|__|_4|

        |_2|__|__|1b| - reset position before animation
                    |2b|__|__|1c| <- animate left
        |_2|__|__|1b|

           |_3|__|__|2b| - reset position before animation
                       |3b|__|__|2c| <- animate left
           |_3|__|__|2b|

              |_4|__|__|3b| <- animate left
  |4a|__|__|_3| - animation complete, set position to end
              |_4|__|__|3b|

  |4a| 1| 2| 3| 4|1b|2b|3b|4b|1c|2c|

One of the main things that I don't like, that these diagrams revealed, is that most of the time the user will be interacting with a clone, and not the original panel. This wouldn't be a problem with images; but if the slider contained forms, video or any other interactive elements, nothing would work as expected.

So, I'll have to put on my thinking cap and try to figure out another method of doing this. Ultimately, if I ever have time, I'd like to completely get rid of cloned panels and just animate the panels, but that changes the "feel" of AnythingSliders.... I guess we'll just have to see :P

Mottie avatar Apr 24 '13 06:04 Mottie