2013-08-04 113 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