SlimScroll JQuery 插件中的 scrollto 问题

Problems with scrollto in SlimScroll JQuery plugin

我有 2 个 DIV 实现了 Slimscroll 插件。两者都工作正常,但一个应该一直向上滚动 <div id="msg_left_sidebar">....</div>(似乎是默认设置),另一个 DIV <div id="chat_content">....</div> 一直向下滚动。使用以下代码几乎可以按预期工作:

$(function(){
    var scrollDown_int = $('#chat_content')[0].scrollHeight;
    $('#msg_left_sidebar').slimScroll({
        height: (browserheight - 190) +'px',
        width: '248px'
    });
    $('#chat_content').slimScroll({
        height: (browserheight - (207 + 190)) +'px',
        width: '526px',
        scrollTo : scrollDown_int+'px',
      });
       //$('#chat_content').scrollTop(scrollDown_int); // this works as good as the scrollTo parameter 
  });

我遇到的问题是:即使内容一直滚动到底部,滚动条本身位于 DIV 元素的顶部。

这意味着,一旦我开始滚动,无论如何(在鼠标上滚动滚轮或抓住滚动条)内容都会一直向上...

这是一个已知问题吗?怎样才能让这个滚动条也到底部呢

请帮忙。希望我的解释足够清楚:-)

Slimscroll 有容器起始位置的选项:

start - top or bottom or $(selector) - defines initial position of the scrollbar. When set to bottom it automatically scrolls to the bottom of the scrollable container. When HTML element is passed, slimScroll defaults to offsetTop of this element. Default: top.

发件人:http://rocha.la/jQuery-slimScroll

如果您将代码调整为以下内容,div 和滚动条都将放置在容器底部:

$('#chat_content').slimScroll({
   height: (browserheight - (207 + 190)) +'px',
   width: '300px',
   start: 'bottom'
});

JSFiddle:http://jsfiddle.net/oqet7pe4/

见下文 link jsFiddle:http://jsfiddle.net/oqet7pe4/50/

// make slimscroll object
var vTable = $("#msg_left_sidebar").slimScroll({ ... });

// and use this command
vTable.slimScroll({scrollTo: scrollDown_int +"px"});

我从 http://jsfiddle.net/oqet7pe4/

修正