How to get the cursor position in TinyMCE or the number of line on which the cursor is in TinyMCE?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- Reference for inserted element through execCommand
- How to fix IE ClearType + jQuery opacity problem i
Here is the part of a function from one of my own plugins i use to get the actual line number:
The function
getBoundingClientRect()
is used to create a box from which we can get several positioning information. Be aware the we need to use a marker-element and reset the caret later on.Update: Info for lineHeight