0
사용자가 텍스트를 선택하여 텍스트를 업데이트하고 있습니다. 그것은 잘 작동합니다. arrow
키를 사용하여 확장하거나 선택 항목을 공제하기 위해 keyup
을 추가했습니다. 하지만 기존 이벤트로 keyup
을 추가 한 후에 작동하지 않습니다. 이것으로업데이트 텍스트를 키로 선택하는 방법
.on('mouseup, mousemove, keyup'
이 교체
:
$('#tenderContent').on('mouseup, mousemove, keyup', '.tenderdocument', function (e) {
e.stopPropagation(); //not working after adding keyup.
if ($.trim(window.getSelection().toString()).length) {
$('#text').text(window.getSelection().toString());
}
});
$('#tenderContent').on('mousemove', '.tenderdocument', function (e) {
e.stopPropagation();
if (!$.trim(window.getSelection().toString()).length) {
$('#text').empty();
}
});
시도했지만 아무것도 업데이트되지 않습니다. – 3gwebtrain