开发者

Stop page scrolling from focus

I just installed a script to focus at my first input field, which is toward the footer. The focus works great, but the page scrolls to the bottom after loading.

Can I still u开发者_如何学编程se the focus and stop the page from scrolling down to the first input field?

http://www.ubspack.com/


Insert this at the end of the page:

 <script type="text/javascript">
 window.scrollTo(0, 0);
 </script>

This will again scroll the page to the top.


$(function(){
     $("input").focus();
     $('html, body').animate({scrollTop:0}, 'slow'); 
});)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜