在IE中禁用文本光标 [英] Disable Text Cursor in IE

查看:104
本文介绍了在IE中禁用文本光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上使用DIV作为简单的DHTML图形按钮。它不包含文本,背景图像提供按钮的外观。这在Firefox和Chrome中完美运行,但在IE中,当单击按钮时,会出现一个闪烁的垂直文本光标,可能是文本行开始的位置。我如何禁用它?

I'm using a DIV as a simple DHTML graphical button on a webpage. It contains no text, and a background image provides the button's appearance. This works perfectly in Firefox and Chrome, but in IE, when the button is clicked a blinking vertical text cursor shows up, presumably where the text line would start. How do I disable this?

我尝试了正常的JS和CSS技巧,比如将onstartselect绑定到function(){return false;}并设置cursor : 没有;和user-select:none; (可能在IE中不支持),但这些没有效果。还有什么我可以做的吗?

I've tried the normal JS and CSS tricks, like binding onstartselect to "function(){ return false; }" and setting "cursor: none;" and "user-select:none;" (which probably isn't supported in IE), but these had no effect. Is there anything else I can do?

编辑:是的,通过文本光标我的意思是Caret,或指示文本插入点的光标。对我来说,如果我在IE7中打开任何页面并单击某些文本,则插入符号会显示在我单击的位置。

Yes, by "text cursor" I mean "Caret", or the cursor that indicates the insertion point for your text. For me, if I open ANY page in IE7 and single-click on some text, the caret appears at the position I clicked.

推荐答案

这是由名为 Caret Browsing的浏览器模式引起的并按F7可以打开/关闭。

This is caused by a browser mode called Caret Browsing and can be toggled on/off by pressing F7.

这篇关于在IE中禁用文本光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆