2013-08-04 108 views
2

簡單的標籤我使用通用jQueryUI的卡口與jQuery custom content scroller,它只能在第一個選項卡上,請幫我解決這個碼 - jsFiddle 本準則與內容滾動

(function($) { 
    $(function() { 
    $('ul.tabs').delegate('li:not(.current)', 'click', function() { 
     $(this).addClass('current').siblings().removeClass('current') 
     .parents('div.section').eq(0).find('>div.box').hide().eq($(this).index()).show(); 
    }) 

    }) 
    })(jQuery); 
    (function($){ 
    $(window).load(function(){ 
      $('.scroller').mCustomScrollbar({ 
     autoHideScrollbar:true 
       }); 
      }); 
    })(jQuery); 

感謝。

回答

1

這是因爲您只在$(window).load上添加滾動條。您需要添加功能,以彌補不斷變化的標籤,以及像這樣:

(function($){ 
    $('.tabs').click(function() { 
     $('.scroller').mCustomScrollbar("destroy"); 
     $('.scroller').mCustomScrollbar({ 
      autoHideScrollbar:true 
     }); 
    }); 
})(jQuery); 

Updated jsFiddle

+0

哦!非常感謝=) – user2151885