繁体   English   中英

IE8、IE9、IE10 闪烁光标问题

[英]IE8, IE9, IE10 Blinking Cursor Issue

我正在制作一个在某些文本选择上显示工具栏的编辑器。 我在 IE 中面临的问题是闪烁的光标仍然显示在工具栏上方。 这特别发生在 IE 中。 闪烁的光标出现在顶部。

这是此问题的示例:

 $('.content').mouseup(function(e) { $('.shy').css({ top: e.pageY - 30 + 'px', left: e.pageX - 30 + 'px' }); $('.shy').show(); });
 .content { height: 300px; width: 300px; border: 1px solid black; overflow: hidden; word-wrap: break-word; z-index: 1; } .shy { height: 100px; width: 100px; background-color: orange; z-index: 2; overflow: hidden; word-wrap: break-word; display: none; position: absolute; }
 <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <div contenteditable="true" class='content'>Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content</div> <div class='shy'> <div>

将焦点移出不是一种选择,因为此应用程序中有更多组件,并且此修复程序不适用于这些情况。 修复需要完全自主。

只需添加

$('.shy').focus();

光标将在 IE7-IE10 上停止闪烁(已测试)

http://jsfiddle.net/2QAxk/6/

UDP1抱歉没有看到您关于“焦点”的更新不是一个选项...

暂无
暂无

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

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