テキスト選択にツールバーを表示するエディターを作成しています。私が 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>
このアプリケーションにはより多くのコンポーネントがあり、この修正はそのような状況では機能しないため、フォーカスを外すことはできません。修正は完全に自律的である必要があります。