2016-01-20 34 views

回答

1

我不知道使用什么样的接口,允许用户滚动到特定行,但是你可以使用下面的代码来设置滚动(demo):

HTML(在演示中使用)

Scroll to row: <button type="button">20</button> <button type="button">40</button> 

脚本

$('button').click(function(){ 
    var $scroller = $('.tablesorter-scroller-table'), 
    row = parseInt($(this).text(), 10), 
    position = $table.find('tbody tr').eq(row).position(); 
    $scroller.scrollTop($scroller.scrollTop() + position.top); 
}); 
+0

该诀窍非常漂亮,甚至与固定列的工作! – DanM