鼠标悬停时文本字段输入焦点
我们有以下代码片段来关注表单中的特定文本字段 onmouseover="this.focus();"
我们在整个用户界面中有很多文本输入字段,它们需要某种输入来自用户。假设目标受众不太懂计算机(例如第一次使用计算机的儿童和成人),在鼠标悬停时将焦点集中到文本字段是否是一个好习惯?
这是一个好习惯吗?否则用户将不得不在键入之前单击文本字段中的内容
We have the following snippet to get focus on a particular text field in a form onmouseover="this.focus();"
We have lots of text input fields throughout the user interface which expect some kind of input from the user. Is it a good practice to provide focus to the text fields onmouseover, assuming the target audience is not that computer savvy (e.g. children and adults who are first time computer users)
Is this a good practice, else users will have to click before they type something into the text field
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,这实际上取决于您想要为用户提供的可用性。
除此之外,这还取决于您拥有的用户类型。
我不认为关注悬停是一个特别好的主意,原因如下:
更高级的表单流程,可以说......通常从表单的第一个字段开始,然后使用 Tab 键通过键盘进行导航。
我建议您努力通过使用 tab 键导航来使表单流程正常(HTML 有一个很好的方法来做到这一点,除非您的代码到处都是并且您有 css 将它们放在特定位置)。
我将保留表单原样,没有鼠标悬停焦点。关注鼠标悬停不是标准行为可能是有充分理由的;)
Well, it really depends on the usability you want to offer your users.
Aside from that, it will depend on what type of users you have.
I don't presume the focus on a hover is a particular good idea for the following reasons:
The more advanced form-processes, so to say... Will usually start with the first field of a form, and then navigate it by keyboard with use of the tab-key.
I recommend you put your effort into making the flow of the form alright by navigating it with the tab key (HTML has a pretty good way of doing this, unless your code is all over the place and you have css putting them on their specific locations).
I would just leave the form as is, without mouse-over focusses. There's probably a good reason why focus on mouseover is not standard behavior ;)
当计算机应用程序将鼠标悬停在某个区域上时,通常不会聚焦该区域。如果您的应用程序以不同的方式执行此操作,儿童和其他初学者会感到困惑。点击=焦点是一般性的事情,不要试图偏离这一点。
更好的解决方案是添加类似
title="如果您想输入内容,请点击鼠标按钮"
。Computer applications does not usually focus a field when hovering over it. Children and other beginners would get confused if your application would do it in a different way. Click = focus is something general, do not try to diverge from that.
A better solution would add something like
title="Click with your mousebutton if you want to enter something"
.