How to set scanning cycle?

https://codepen.io/newdecline/pen/qyRzOY

Can't figure out how to make a check that if the index of the slider is greater than the index of the array then the index you have to do again that would equal 0 in a circle dangled sliders
June 3rd 19 at 19:06
1 answer
June 3rd 19 at 19:08
Solution
if( slideIndex > sliderItem.length ) {

Oh? You do not really know that arrays are indexed starting from zero? Will not sliderItem.length valid value element with the same index anymore. Replace > to ===.
Yes, I know what zero-based numbered, but it is a stretch learning the language, thank you .
the item with this index anymore
and where did he go ? - adriana_Sawa commented on June 3rd 19 at 19:11
what do you mean "what happened"? He was not and can not be. Or you the word "already" confused? So it is said in the sense that with index length - 1 is STILL there, but with length no longer. An emphasis on the index and not to a specific element. - favian_Torp12 commented on June 3rd 19 at 19:14
slideIndex >= sliderItem.length

So still working, but right now trying to figure out why.. - adriana_Sawa commented on June 3rd 19 at 19:17
of course it works - after checking for equality in this embodiment, is also present. - favian_Torp12 commented on June 3rd 19 at 19:20
, https://codepen.io/newdecline/pen/qyRzOY
and you can still tell how to tie the point at the bottom of the slider on the slider, it still only managed to tie the colors change when you change the pictures but when I click on the point of color change and no pictures - adriana_Sawa commented on June 3rd 19 at 19:23
to not duplicate code, it makes sense to make a function that will enable specified slide and use it - and when someone clicks on .prev/.next, when someone clicks on .dots. Somehow so. - favian_Torp12 commented on June 3rd 19 at 19:26
Thanks again , now I can study - adriana_Sawa commented on June 3rd 19 at 19:29

Find more questions by tags JavaScript