【发布时间】:2014-05-15 08:13:24
【问题描述】:
我使用 scrolltop 功能在单击按钮时滚动到顶部,但它不起作用?
** jquery ******
jQuery('.scroll').click(function ()
{
jQuery("html, body").animate({ scrollTop: '#fields2' }, 'slow');
return false;
});
***** html 代码 ** ***
<div id="fields2">
..............
...............
<input class="send_btn scroll" type="button" value="back"/>
</div>
【问题讨论】:
-
试试
scrollTop: $('#fields2').offset().top
标签: javascript jquery html