[英]jQuery get textarea cursor/caret X,Y position and show a DIV underneath
I am trying to implement something like the "Change/Remove Link" in Gmail/Google Docs richtext WYSIWYG edtior, when you type a URL, a div shows underneath it says "Goto Link, Change, Remote" 我正在尝试在Gmail / Google Docs富文本格式所见即所得版本中实现“更改/删除链接”之类的功能,当您键入URL时,div下方会显示“ Goto Link,Change,Remote”
How could I write something like that using jQuery? 我如何使用jQuery写类似的东西?
Thank you in advance! 先感谢您!
Answer: http://jsfiddle.net/morrison/57BR3/ 答案: http : //jsfiddle.net/morrison/57BR3/
What it does: 它能做什么:
What it does not do: 它不做什么:
You're suggesting you're building a WYSIWYG editor. 您建议您正在构建所见即所得的编辑器。 Are you sure you want to use a textarea?
您确定要使用文本区域吗? Textareas don't support HTML.
Textareas不支持HTML。 To answer your later comment , the best way to get the (x, y) position of the caret in a text area is to use the textarea-caret-position plugin .
为了回答您以后的评论 ,获取插入符在文本区域中的(x,y)位置的最佳方法是使用textarea-caret-position插件 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.