-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
New Ionic's v1.2 ion-slides/swiper active/previous Index #5739
Comments
Did you find a fix for this? I believe I am experiencing a similar issue while trying to create dynamic slides. |
@mattchue still trying to get my head around, spent about 4/5 days trying to figure it out. |
I've managed to isolate my issue down to something codepen-sized. I believe that Codepen: http://codepen.io/anon/pen/vGGvaP?editors=1010
I'm pretty sure that Swiper does something with hiding and showing the duplicate slides to make the looping easier, and those duplicate slides are just not tied to the controller's |
@mattchue painful eh...similar to what am doing, creating a recyclable slides, 3 of 'em to be exact, and to reuse each slide when looping around to create illusion of infinite swiping. |
@t0mm13b yeah, that's what i did with slidebox. i was hoping to be able to get a bit of a cleaner implementation than that with the swiper component. were you planning on reopening this issue? |
could do with reopening it, as there's something seriously wonky with the new swiper component, after all, the old slidebox is in the deprecation/departure lounge and did not have much properties and was leaning on high hopes that this newer component would make it easier to deduce. how wrong I was. plus the documention on ionic's site about this new component is sparse. |
I've been using the Swiper docs with which you have to do a little translating, but overall they're easy to use to figure out how the new swiper works. |
Hi @mattchue and @t0mm13b, I have started look at this issue. I have an active branch open called I am hacking it up here just trying to get it working correctly, then I will clean the code up. Here's where I'm at:
Any thoughts on this? |
Hi @danbucholtz thanks for the comment, and for taking the time to check it out. For point 2, that would somewhat, in my head, conclude that why the indexes are out. Unless there's something else at play there in relation to swiping. Is there anything else that can be done? Thanks again. |
Hi @t0mm13b and @mattchue, as a status update, I have come up with a solution for this... but it is not at all performant 💯 . I am going to come up with something that performs better. It may require an API change, so would you two be open to testing it out and giving it feedback if we go that route? |
Hi @danbucholtz, Thanks for getting back 👍 Thats great to hear, and yes, I am open to testing it out. |
@danbucholtz, I can definitely test it as well. |
I think I have resolved this issue. Can you go ahead and test against the nightly build tomorrow or later? You can pull it down from here. Please use that file in place of your I will re-open the issue if you continue to have issues. Thanks, |
Short description of the problem:
Attempting to create an infinite slider view of dynamic data over three slides,
This is inspired by the thread(s) which uses the older original slidebox. I am attempting to create a new version using the latest v1.2.4 ion-slides.
There is a funny going on with the swiper's activeIndex and previousIndex as far as the option's loop set to true is concerned.
The idea was to calculate the next slide in sequence based on the array and put it into a slider's position. The index offsets are throwing it off. The pagination is there for a guide to determine where are we on the slider's viewpoint.
I have set the effect to be 'coverflow' and when going from beginning, swipe to the left to right, to wrap around to the end, the effect is noticeable and the indexes go into negative.
The jsfiddle is here, https://jsfiddle.net/t0mm13b/q4vb4tee/1/
I am testing it on the desktop.
Can anyone shed some insight into this based on the console log which shows how the indexes go into negative.
The text was updated successfully, but these errors were encountered: