Forums

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

Home Forums JavaScript Instances for jquery addClass() to not work.

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #45980
    Anonymous
    Inactive

    In what situations will jquery addClass() property not work? what makes it not work?

    #141038
    Paulie_D
    Member

    Java script not being enabled.

    #141039
    Anonymous
    Inactive

    @Paulie_D -_-
    Well im trying to get this button to add a class but its not working. Any idea why? http://codepen.io/Jarolin/pen/npECh

    #141040
    Alen
    Participant

    what it is supposed to do? change background color? it works for me

    #141041
    Anonymous
    Inactive

    @alenAbdula The body background color works fine. But the button switch is suppose to change its gradient. But thats not working.

    #141042
    Eric Gregoire
    Participant

    There’s a mix of ids and classes. Make “switch” in the CSS and HTML a class and it works. But you need “toggleClass” rather than just add because it adds it but doesn’t return it to the original position.

    #141043
    Anonymous
    Inactive

    @Boogiesox i did what you said and its working great. Thank you.

    #141044
    Alen
    Participant

    It’s because you’re using ID’s http://codepen.io/anon/pen/aelzr

    #141045
    Anonymous
    Inactive

    @AlenAbdula Thanks for the help i fixed it :). Can you delete that pen? kinda making that already :P

    #141049
    Anonymous
    Inactive

    .

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