Forums

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

Home Forums JavaScript Adding a class 'active' to an element only works one time

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #255561
    gentlemedia
    Participant

    Hi again!

    I’m adding and removing with jQuery a bunch of classes on click events to trigger my CSS animations. It kind of works, but only one time. Once I clicked on a list item to add a class ‘active’, I can’t do that a second time when I click on that same item.

    I have pen with the issue, so If you click on UI Design for example, you see some content fade in, By clicking the X the content fades out and the list items fades back in. But clicking on UI Design it doesn’t add the ‘active’ class anymore to trigger the content fade in animation. I can’t figure out why it only does it one time.

    https://codepen.io/gentlemedia/pen/YQPrZX

    Thanks in advance!

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.