Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inifinite slides with change by multiple? #471

Open
bghouse opened this issue Dec 11, 2012 · 6 comments
Open

Inifinite slides with change by multiple? #471

bghouse opened this issue Dec 11, 2012 · 6 comments
Labels

Comments

@bghouse
Copy link

bghouse commented Dec 11, 2012

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?

@Mottie
Copy link
Contributor

Mottie commented Dec 13, 2012

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.

@bghouse
Copy link
Author

bghouse commented Dec 13, 2012

Thanks, that would be super!

@bghouse
Copy link
Author

bghouse commented Jan 16, 2013

Hi Mottie,
Any update on this issue?

@Mottie
Copy link
Contributor

Mottie commented Jan 16, 2013

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).

@bghouse
Copy link
Author

bghouse commented Jan 17, 2013

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!

@Mottie
Copy link
Contributor

Mottie commented Apr 24, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants