Matej Posted September 18, 2014 Share Posted September 18, 2014 Hi there , i have this collapse menu http://codepen.io/anon/pen/kICuq , but i cant figure out ,how can i do that when i click on "menu" , second time ,the black div dissapear(the black div under the specific menu ofc)? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 18, 2014 Share Posted September 18, 2014 At the start of the function you'll need to first check if the div for the menu they clicked on is expanded already, and if so then not to expand it again. Using the toggle method is the same as using the add method, because you first remove the class from everything. Toggling will only ever add it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now