In js, jqury is not strong, for the sake of interest I wanted to do something like that started with a simple change of slides, the problem is that when you move the mouse over there, the slider goes) how to get rid of it?

PS It seems that the animation is not closed, not a separate function, but does part of that and part of the other, and as a result, porridge. In general, I will be glad to any advice. Here is the code on the codepen.

<p data-height="511" data-theme-id="0" data-slug-hash="XNeELR" data-default-tab="result" data-user="junior-web-dev" data-embed-version="2" data-pen-title="XNeELR" class="codepen">See the Pen <a href="http://codepen.io/junior-web-dev/pen/XNeELR/">XNeELR</a> by junior-web-dev (<a href="http://codepen.io/junior-web-dev">@junior-web-dev</a>) on <a href="http://codepen.io">CodePen</a>.</p> <script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script> 
  • the decision depends on the expected behavior. at the moment, when you hover on each part of the slide, the animation change is started. therefore, with fast hover on everything, the animation alternately twitches, because tries to stream each slide. as an option, you can put a delay on the change of the slide, for example - lexxl
  • $ (". screen-line"). hover (function (e) {clearTimeout (timerStartAnim); var timerStartAnim = setTimeout (function () {elem = e.currentTarget; animStart (elem);}, 400)}); On a hover, there is a delay before running the animStart function. I increased it to 1000 now, if you move the bear for longer than 1000, it starts flashing), but everything was as it was, maybe the delay is not correctly implemented? - junior-web-dev
  • changing that interval, in theory, changes the delay before changing slides. I mean, a second passes, and then each image tries to add in the same way. But you need a delay before performing the entire function of the shift. PS in fact, if you need to repeat the functionality, you can explore it on the original site by viewing the page code - lexxl
  • one
    lexxl thanks for the help, the error was that clearTimeout did not clear the timer, it did not see the variable with the timer id, since the timer was declared not globally but in a function, and also fixed the hoverOut bug again, I started everything again, I cleared it to not happen , its OK now. I don’t close the question yet, maybe there will be more questions about this slider. Thank. - junior-web-dev

0