简体   繁体   English

在contenteditable div中获取插入符号相对于窗口的视觉位置

[英]Get caret's visual position with respect to window in contenteditable div

I have contenteditable div, and I need to show a dropdown just below the current position of the caret. 我有一个内容可编辑的div,我需要在插入符号的当前位置下方显示一个下拉列表。

For instance, if I type 'foofoofoofoo' in my div, I need to show a dropdown just below the current position of the caret which is at the end of 'foofoofoofoo'. 例如,如果我在div中键入“ foofoofoofoo”,则需要显示一个下拉列表,该下拉列表恰好在“ foofoofoofoo”结尾处的插入符号的当前位置下方。 How do I determine this position? 我如何确定这个位置?

这个图书馆就像一个魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM