tinymce编辑器中部分文本高亮时如何提示? 像这样
$('textarea').select(function(){
alert('123');
});
最佳答案
这是一个demo使用 onMouseUp event显示the currently selected content (如果非空)
Javascript:
tinyMCE.init({
// General options
mode: "exact",
elements: "second",
// Skin options
skin: "o2k7",
skin_variant: "silver",
setup: function (ed) {
// on mouse uo get selected text
ed.onMouseUp.add(function (ed, e) {
var highlighted = tinyMCE.activeEditor.selection.getContent();
if (highlighted) alert(highlighted);
});
}
});
HTML:
<textarea rows="10" cols="30" id="second"></textarea>
关于javascript - tinymce编辑器中部分文本高亮时如何提醒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21782185/