Closed Le-future closed 8 years ago
I'm not sure this is an issue with wallop itself, but with the timers in your code and also the CSS.
Im not exactly sure but it seemed like in your CSS you were overriding the animations and stuff.
If you want to write custom animations, you've gotta make sure you really understand how to do it, otherwise it gets tricky. I suggest you use some of the presets.
The real problem though, is that you setTimeout
on keydown, meaning every time someone presses left or right, its activating the setTimeout!
I updated your code here with the Fade
animation.
I also cleaned up your JS a little to use wallop's events rather than faking a click event on an element.
I also think you shouldn't restart the autoplay once the user has interacted with the slider, it's probably not a good user experience.
Thanks for the cleaning about the JS!
Actually you're right, this is not an issue with the plugin. The problem comes from the setTimeout when the user clicks on the arrows. I should stop it before to replay it if the person click more than once.
I try to do that but I can't xD
///////
Thanks for the edit! Yes I'm still hesitating to restart or no the slide...
I'm going to try a solution, I keep the thread posted :-)
Great, good luck! :+1:
Hey mate!
Firstly, thank you so much for this very useful plugin!
I've added an autoplay function and I'm trying to add a restart after the user clicks on his keyboard on the left or right arrow. Problem, if you click more than once on one of the arrow, the slide goes weird ^^
Here is a pen of my work : http://codepen.io/Le-future/pen/Nxexrw
Don't hesitate to press more than twice the arrow of your keyboard to see the problem.
Thanks by advance for any help :-)