Forums

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

Home Forums JavaScript classToggle Loop Issue

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #173451
    Luke Harrison
    Participant

    Hi there, so I’m working on a pen (http://codepen.io/lukedidit/pen/EdJzK) and I’m trying to make an animation loop where a class is toggled on and off but for some reason the code I have working in my own tests isn’t now working in codepen. Just wondering if there’s anything wrong with it?

    #173452
    Paulie_D
    Member

    I’m trying to make an animation loop where a class is toggled on and off

    Could you explain a little more…toggling classes seems like an odd way to create an animation.

    EDIT…that said, you have to tell Codepen to include Jquery (in the JS ‘cog’ options)

    http://codepen.io/Paulie-D/pen/zsIHL

    #173453
    Luke Harrison
    Participant

    Ah that would explain why it wasn’t working. I’ve been replicating a video game sprite animation using the multiple box-shadows trick, and each frame is assigned to a different class if that makes sense.

    Thanks.

    #173454
    Paulie_D
    Member

    Indeed, given the complexity of the ‘frames’ I can see why class toggling makes sense.

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