There is a slider with js-animation. Animation occurs by class substitution, their coordinates are given in css and in js - circleCoords .
I spread the code on plunker, because there is a lot of it and in order to understand the problem you need to see the event through the eyes: https://plnkr.co/edit/qHn1HytgxucUwl0tkBTe?p=preview
Before we clicked on the carousel element, the animate function each time takes an array with the names of the classes, at each iteration the last element of the array in the list is placed on the front (a cyclic shift occurs). When you click on an element, we change the order of the elements in the array, and submit it to the animate function in the appropriate order after changing classes in the html tree.
But for some reason, after the click, the elements begin to move erratically, and not as follows - one after another in the newly built queue. I am sure that I missed some trifle somewhere, I need a fresh look from the pro) Thank you for your attention!