Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close current if you click on it #1

wants to merge 1 commit into
base: master


None yet
1 participant
Copy link

commented Apr 17, 2019

Add in tracking of the current so if you click on the currently open one it closes.
For the class remove it works in this case but if you had other class names on the same div, for example your html was
class="fooone barone open
your code would remove all the class. You'd really want to do something like
or for older browsers
opendiv.className = opendiv.className.replace(/\bopen\b/, " ")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.