Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在母版页中有一个嵌套控件。当我明确地将焦点设置在该控件的第一个文本框上时,页面将向上移动到第一个文本框。有没有办法防止页面跳起来但仍然设置焦点,这样用户就不必点击文本框?我希望他们能够在页面显示时立即开始输入。
我认为这是一个浏览器设置,因为它是自动工作的:
http://jsfiddle.net/KjCuM/
您可以进行修复,然后滚动回页面顶部,但我认为如果有焦点,控件在屏幕上可见是有意义的。否则用户将无法看到他们提交的内容。