0

I have a Hamburger menu that activates slide-push menu and animates the SVG in to a "close" button. This javascript adds the .active class when clicked. If I click somewhere else rather than "close" icon, it doesn't animate it self back. How do I revers the function that will work if I click anywhere else?

 <script type="text/javascript">
    document.querySelector(".svg-menu-toggle").addEventListener("click", function () {
        this.classList.toggle("active");
    });
</script>
user1955837
  • 15
  • 1
  • 4
  • possible duplicate of [Add click event on window, but ignore all links that start with https](http://stackoverflow.com/questions/25445857/add-click-event-on-window-but-ignore-all-links-that-start-with-https) – Mritunjay Aug 22 '14 at 15:36
  • possible duplicate of [How to detect a click outside an element?](http://stackoverflow.com/questions/152975/how-to-detect-a-click-outside-an-element) – abc123 Aug 22 '14 at 15:36

0 Answers0