简体   繁体   English

所选文本IE8上的手形光标css

[英]hand cursor css on the selected text IE8

i have a problem of hand cursor im currently selecting the text and highlighting it but problem is i want a hand cursor on the highlighting text 我在当前选择文本并将其突出显示时出现了手形光标的问题,但问题是我想在突出显示的文本上使用手形光标

here is the running code of the problem any suggestion 这是问题的运行代码任何建议

http://jsfiddle.net/8mdX4/135/ http://jsfiddle.net/8mdX4/135/

and i want to run it in the IE8 我想在IE8中运行

用这个

style="cursor:pointer"

Add a CSS rule in your example: 在示例中添加CSS规则:

​span { 
    cursor: pointer;
}​

This will enable the hand-cursor on the generated span element on the page. 这将在页面上生成的span元素上启用手形光标。 Preferrabally you'd add an extra class to the generated span so not all span elements get the hand cursor. 最好将一个额外的类添加到生成的跨度中,以便并非所有的跨度元素都可以获取手形光标。 then you can add that class to the css like: 然后您可以将该类添加到css中,例如:

​span.highlight { 
    cursor: pointer;
}​

That is not possible using execCommand() as it does not support it. 使用execCommand()不可能,因为它不支持它。 An alternative would be wrap the selected text in <span> tag and set the css property for it but it becomes PITA if you have html tags into your text. 另一种选择是将所选文本包装在<span>标记中并为其设置css属性,但是如果文本中包含html标记,它将变为PITA。

Nonetheless, this might help you: Inserting string at position x of another string 但是,这可能会帮助您: 在另一个字符串的位置x插入字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM