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

Checking if class exists #218

Open
ptmartins opened this issue Oct 5, 2017 · 0 comments
Open

Checking if class exists #218

ptmartins opened this issue Oct 5, 2017 · 0 comments

Comments

@ptmartins
Copy link

To check if there is no class with that name we should test against an index of (-1), i.e. , the class doesn't exist so we can add the new class. Otherwise it could keep adding the same class, since className index will always be different from 0.

https://github.com/viljamis/responsive-nav.js/blob/87f62468fc4e3354043d3337affb6b274db1aaac/client/src/helpers.js#L113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant