Grow your CSS skills. Land your dream job.

classToggle Loop Issue

  • # June 23, 2014 at 3:12 am

    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?

    # June 23, 2014 at 3:22 am

    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)

    # June 23, 2014 at 3:28 am

    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.

    # June 23, 2014 at 3:30 am

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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".