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

the images come between each other #59

Closed
ghost opened this issue Feb 11, 2019 · 7 comments
Closed

the images come between each other #59

ghost opened this issue Feb 11, 2019 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 11, 2019

I start the component in image 0 and I have four images in the slide when I use the goToSlide (i) method, where i is equal to for example 3, image 2 and image 3 are shown at the same time.

The 2 is shown automatically, and the third enters with the effect of the slide.

@ghost
Copy link
Author

ghost commented Feb 12, 2019

In case if this isn't a error, i need to know the correct way to use the slideshow.

Thanks

@dockleryxk
Copy link
Owner

This seems related to #38. I'm still working on a fix for this.

@ghost
Copy link
Author

ghost commented Feb 13, 2019

Yes, it is the same problem. Excuse me, I read it before publishing but I had not understood that it was the same.

I see that problem comes from quite some time ago. Do not really look at your code 100%, but look at why I'm interested in solving this problem and if I can help you better.

At first glance, in the first three lines of the goToSlide() I see that there is a double assignment to slideIndex: first this.slideIndex = index - 1, and then in setSlideIndex(), this.slideIndex += indexDirection (in this case indexDirection = 1).
I think your problem is there, and I do not have complete knowledge of your code to give you a solution, but I imagine that these assignments may need a conditional or maybe be done at another time.

Or maybe I should go through all the intermediate images before assigning the indicated one.

If you give me explanations why I make this assignment in two parts instead of doing it once, I could keep thinking about how we can solve it.

@dockleryxk
Copy link
Owner

@kryne no problem, I am always happy to discuss.

Basically, classes are assigned to create sliding animations. The logic goes like this -- goToSlide() is called, so go to the slide right before the slide that is desired (this.slideIndex = index - 1), then increment to the desired slide so the animation is triggered.

Perhaps there is a better way or I need more checks to make sure things happen correctly.

@ghost
Copy link
Author

ghost commented Feb 14, 2019

Exactly, as I understood it and clearly the problem is that.

In my opinion it is wrong to assign the previous slide to the one that you want to see without performing the slide effect.

As a quick solution I think I should go through all the intermediate slides before I get to the desired one.

@dockleryxk
Copy link
Owner

@gzoppo I just saw this but that is a good idea, I will try this!

@dockleryxk dockleryxk added the bug label Mar 28, 2019
@dockleryxk
Copy link
Owner

I'm going to close this though since it is a duplicate of #38

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

1 participant