我使用通用 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);
谢谢。
最佳答案
这是因为您只在 $(window).load
上添加滚动条。您还需要添加功能来补偿选项卡的更改,如下所示:
(function($){
$('.tabs').click(function() {
$('.scroller').mCustomScrollbar("destroy");
$('.scroller').mCustomScrollbar({
autoHideScrollbar:true
});
});
})(jQuery);
关于jquery - 带有内容滚动的简单选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18047290/