单击某个元素会设置焦点但不会设置光标?
我有一个 html 页面,我将焦点设置在加载时的第一个输入元素上。我可以看到焦点已设置,因为我要求元素的背景变为橙色,并且我可以看到橙色背景。但是,光标未显示在元素中。
然后,当我单击其他输入元素时,我可以看到焦点移动到它们,但仍然没有显示光标。仅当我使用 Tab 键时才会出现光标。
请有人向我解释为什么会发生这种情况以及如何在不使用 Tab 键的情况下使该光标出现?
这仅适用于 IE8。 (这是一个 Intranet 站点)
按照要求编写的代码,说明我如何设置焦点:
$(document).ready(function(){
$('#rachel').focus();
});
编辑
我没有想到提到问题发生在看起来像层一样实现的弹出窗口上。图层是否有可能阻挡光标?
I have an html page where I set the focus on the first input element on load. I can see that the focus is set because I ask the background of the element to go orange and I can see the orange background. However, the cursor is not shown in the element.
Then when I click on the other input elements, I can see the focus move to them but still no cursor is shown. The cursor only appears when I use the tab key.
Please could someone explain to me why this happens and how I can make this cursor appear without having to use the tab key?
This is for IE8 only. (It's an intranet site)
Code as requested for how I'm setting focus:
$(document).ready(function(){
$('#rachel').focus();
});
EDIT
I didn't think to mention that the problem is happening on a popup window that looks to be implemented like a layer. Is it possible for layers to block the cursor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论