是:
$("#container").scrollTop($("#elementToScrollTo").position().top);?
Run Code Online (Sandbox Code Playgroud)
如果你想顺利进行:
$("#container").animate({
scrollTop: $("#elementToScrollTo").position().top
}, 1000);
Run Code Online (Sandbox Code Playgroud)
在这里,有一个小提琴:http://jsfiddle.net/adrianonantua/nxHE8/
var scr = $('#box')[0].scrollHeight;
$('#box').animate({scrollTop: scr},2000);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12511 次 |
| 最近记录: |