停止从焦点滚动页面 [英] 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 use the focus and stop the page from scrolling down to the first input field?
推荐答案
$(function(){
$("input").focus();
$('html, body').animate({scrollTop:0}, 'slow');
});)
这篇关于停止从焦点滚动页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文