我有一个像这样的span标签的tinymce textarea : ...
.
单击文本范围时,我想在文本旁边显示一个弹出窗口.
问题是文本隐藏在iframe中,因此JQuery无法访问它.
有没有办法用JQuery更改iframe中的内容,特别是使用tinymce?我不能只是复制内容,然后将其粘贴回来,因为我需要获取文本在屏幕上的位置的坐标为此,我会使用这个:
position = $(this).offset();
this
span标记在哪里
是的,这是可能的,也很容易.
var editor = tinymce.editors[0]; // or tinymce.get('your_editor_id') or tinymce.activeEditor var $ed_body = $(editor.getBody()); // do whatever you want with the editor content located inside the body