jScrollPane滚动条

官方网站:http://jscrollpane.kelvinluck.com/

demo:http://jscrollpane.kelvinluck.com/auto_reinitialise.html


scrollToBottom方法滚动到底部

$(function(){
    var settings = {
        showArrows: true,
        autoReinitialise: true
    };
    var pane = $('.scroll-pane')
    pane.jScrollPane(settings);
    var api = pane.data('jsp');
    var contentPane = api.getContentPane();
    var i = 1;

    setInterval(
        function()
        {
            contentPane.append(
                $('<p />').text('This is paragraph number ' + i++)
                );
            api.reinitialise();  
            api.scrollToBottom(); 
        },
        1000
        );
});  

 

posted @ 2012-12-16 23:53  前端咖  阅读(598)  评论(0编辑  收藏  举报