See
function rodarslider(){
(...)
caption.classList.remove('sliderfect');
caption.classList.add('sliderfect');
(...)
}
The above function is the small stretch of the algorithm of a pure JS slider I'm doing.
caption
- is the variable that stores the 'figurecaption' of my slider.
sliderfect
- is the class that changes the caption position from left to right with 1 second transition and strips display:none
by doing an animation.
My intention is to have the class removed in a single click event and then placed again to cause the effect. But that does not happen.
It would be easy if there were two events, for example: onmouseover
adds the class and onmouseout
takes the class. The challenge (for me) is to bring this animation into one event with every click.
If it was not clear I did this mini version of my script link