JQuery Add/Remove Class Issue
Building a simple Multilevel push menu based on CSS classes, It has no
javascript animations and runs on CSS transform/transitions. It works fine
on every part other than toggling the is-open classes.
When a user clicks on a link, it should first remove the .is-open class.
Then add it so the animation activates.
If i say change the .is-open class in the second stage to
.addClass("foo"); it has no problem removing the .is-open class and adding
the .foo class. So i'm wondering what the problem is with this section of
the code.
You can find the code here http://jsbin.com/EjUQ/2/
On the demo you'll find that menus without a submenu load nothing. This is
the correct behavior. The problem I'm having is that I would like the Menu
to close before opening a new one. So removing the .is-open class then
applying it again.
e.g
Link 1, 4,7 don't have submenu's so nothing with open on click/touch,
clicking the menu button will prompt nothing to happen. This is the
correct behaviour.
Link 2,3,5,6 have submenu's, so it opens on click/touch and the menu
button will toggle the menu to open/close.
Hopefully someone can point me the direction of what i'm doing wrong. Thanks.
No comments:
Post a Comment