Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Css Keyframe animation on click is added and removed only once Reply To: Css Keyframe animation on click is added and removed only once

#243221
amanda_
Participant

Do you have a codepen example? I can’t see the code. It could be an issue with using click function

$(element).click(function(){
// do something //
});

versus using on click

$(parent ).on( "click", element, function() {
 // do something //
});

because click function doesn’t work with dynamically added elements.

I find I have less issues if I create an if statement for click functions. But make a codepen demo, it will help.