0
如何滚动到顶部#studentName
?Div with scroll bar - 使用scrollTop滚动到顶部()
我用过css到#studentName
。所以滚动条出现在100px之后。所以我需要的是当goTop()被触发时能够去#studentName
的顶层。
CSS:
#studentName{
overflow-y: scroll;
max-height: 100px;
}
这是我已经试过。 (没有滚动)
function goTOP(){
$('#studentName').animate({ 'scrollTop': 0 }, 100);
}
上面的代码对我来说工作得很好。可能会在其他代码中的其他位置发布。 – Abhijeet 2014-10-29 16:04:18