title: Multiple functions in jquery toggle
body: <p>I have seen multiple functions inside jquery toggle function but i cannot understand their flow of execution. Even there is no any documentation in <a href="http://api.jquery.com/toggle/" rel="nofollow">jquery</a> Official site.</p>
  
  <p>Here is function:-</p>
  
  <pre><code> $('#menu-toggle').toggle(
      function() {
          console.log('toggle 1 fn');
          $('body').addClass('left-side-collapsed').removeClass('sidebar-colors');
          $('#sidebar .slimScrollDiv').css('overflow', 'initial');
          $('#sidebar .menu-scroll').css('overflow', 'initial');
      }, function() {
          console.log('toggle 2 fn');
          $('body').removeClass('left-side-collapsed')
          $('#sidebar .slimScrollDiv').css('overflow', 'hidden');
          $('#sidebar .menu-scroll').css('overflow', 'hidden');
      }
  );
  </code></pre>