使水平滚动条从右端开始

Make horizontal scrollbar start at right end

本文关键字:开始 水平 滚动条      更新时间:2023-09-26

在mCustomScrollbar中,我想默认将滚动条放置在水平位置的右端,所以我尝试了这个:

$('.content').mCustomScrollbar("scrollTo",'last', {horizontalScroll: true});

这不起作用。以下操作有效,但不会将滚动条移动到正确的位置:

$('.content').mCustomScrollbar({horizontalScroll: true});

我应该怎么做才能使水平滚动默认显示在右侧?

尝试以下

(function($){
    $(window).load(function(){
        $(".content").mCustomScrollbar({advanced:{ // Advanced options
           autoScrollOnFocus: false,
           updateOnContentResize: true, // Scrollbar will be updated on content resize
           updateOnBrowserResize: true  // Scrollbar will be updated on browser resize
        }});
    });
})(jQuery);

检查此链接以下载http://www.4shared.com/document/KxCFmv7E/jquerymCustomScrollbarconcatmi.html