Tab 'a' click issue
<p>I've a simple tab script with scroll plugin, When I click on each tab, the scroll of that tab will be activated, but there is a problem because if you click two times on each tab you will have two instance of scroll on your page! here is my code, Any ideas?</p>

<p><strong>P.S I using mCustomScrollbar plugin.</strong></p>

<pre><code>(function($){
    $(window).load(function(){
                $('ul.tabs').each(function(){
                var $active, $content, $links = $(this).find('a');
                $active = $($links.filter('[href="' + location.hash + '"]')[0] || $links[0]);
                $active.addClass('active');
                $content = $($active.attr('href'));
                $links.not($active).each(function() {
                    $($(this).attr('href')).hide();
                });
                // Set scrollbar to main item
                $('#mContent').mCustomScrollbar();
                // Bind the click event handler
                $(this).on('click', 'a', function(e)
                {
                    var $currentScroll = null, $currentTab = $(this).attr('href');
                    switch ($currentTab)
                    {
                        case '#tabs-contentDescription':
                              $currentScroll = '#mContent';
                              break;
                        case '#tabs-contentChangelog':
                              $currentScroll = '#mChangelog';
                              break;
                        case '#tabs-contentPermission':
                              $currentScroll = '#mPermission';
                              break;
                    }
                    console.log('Current tab is: ' + $currentTab + ' And current scroll div is :' + $currentScroll);
                    // Make the old tab inactive.
                    $active.removeClass('active');
                    $content.hide();
                    // Update the variables with the new link and content
                    $active = $(this);
                    $content = $($(this).attr('href'));
                    // Make the tab active.
                    $active.addClass('active');
                    $content.show();
                    $($currentScroll).mCustomScrollbar();
                    e.preventDefault();
                });
        });
    });
}) (jQuery);
</code></pre>
