title: close dropdown menu with js on onclick event
body: <p>i had asked a question on closing dropdown with pure css <a href="https://stackoverflow.com/questions/24885755/close-dropdown-menu-on-click-pure-css/24886804#24886804">here</a> and some said it is not possible to i had to find other way i read on js and im currently doing the coding with js now but i had one problem with the code it is not behaving properly it show all the dropdown and destroyed the submenu as well..any tutorial on this is appreciated or any suggestion here is the fiddle i made for this problem <a href="http://jsfiddle.net/guradio/gvmRX/18/" rel="nofollow noreferrer">here</a></p>
  
  <p>this is the js</p>
  
  <pre><code>$(function () {
        $('.click-nav &gt; ul').toggleClass('no-js js');
        $('.click-nav .js ul').hide();
        $('.click-nav .js').click(function(e) {
          $('.click-nav .js ul').slideToggle(200);
          $('.clicker').toggleClass('active');
          e.stopPropagation();
        });
        $(document).click(function() {
          if ($('.click-nav .js ul').is(':visible')) {
            $('.click-nav .js ul', this).slideUp();
            $('.clicker').removeClass('active');
          }
        });
      });
  </code></pre>