Reputation: 43
I use universal jqueryUI tabs with jQuery custom content scroller and it only works on the first tab, pls help me fix this code - jsFiddle This Code
(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);
Thanks.
Upvotes: 2
Views: 218
Reputation: 25974
It's because you're only adding a scroller on $(window).load
. You need to make add functionality to compensate for changing tabs as well, like this:
(function($){
$('.tabs').click(function() {
$('.scroller').mCustomScrollbar("destroy");
$('.scroller').mCustomScrollbar({
autoHideScrollbar:true
});
});
})(jQuery);
Upvotes: 1