如何在CKEditor中将光标位置设置为文本结束? [英] How to set cursor position to end of text in CKEditor?

查看:1029
本文介绍了如何在CKEditor中将光标位置设置为文本结束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将光标设置在CKEditor内容的末尾?



这个开发者也问了,但没有收到任何答案: p>

http:/ /cksource.com/forums/viewtopic.php?f=11&t=19877&hilit=cursor+end



我想设置焦点在文本末尾的CKEditor中。当我使用:

  ckEditor.focus 

它带我到CKEditor里面的文本的开头。

解决方案

Dan的回答对我来说是奇怪的结果,但是小改变(除了拼写错误) >

  var range = me.editor.createRange(); 
range.moveToElementEditEnd(range.root);
me.editor.getSelection()。selectRanges([range]);


Is there a way to set the cursor to be at the end of the contents of a CKEditor?

This developer asked too, but received no answers:

http://cksource.com/forums/viewtopic.php?f=11&t=19877&hilit=cursor+end

I would like to set the focus at the end of the text inside a CKEditor. When I use:

ckEditor.focus();

It takes me to the beginning of the text already inside the CKEditor.

解决方案

Dan's answer got strange results for me, but minor change (in addition to typo fix) made it work:

var range = me.editor.createRange();
range.moveToElementEditEnd( range.root );
me.editor.getSelection().selectRanges( [ range ] );

这篇关于如何在CKEditor中将光标位置设置为文本结束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆