我尝试使用以下代码:
$('#divid').html(html).animate ({scrollTop:0}, "fast"); // Are slow, medium, fast parameters.
Run Code Online (Sandbox Code Playgroud)
我也厌倦了使用这段代码:
$('#divid').html(html).animate ({scrollTop:0}, "500");
Run Code Online (Sandbox Code Playgroud)
我的最终目标是让用户能够配置滚动速度并将该参数传递给animate函数.但是,这两种方法似乎都没有对滚动速度产生影响.我究竟做错了什么?
Sea*_*kin 11
该animate函数期望持续时间为字符串或数字.只需将其作为数字传递即可.
$('#divid').html(html).animate ({scrollTop:0}, 500);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20671 次 |
| 最近记录: |