I have read some posts on the condition of the carat, but no one responds to my special issue.
problem : I want the carat to be positioned at the exact location of the div2 Therefore, I need some way of reading the place where the user clicks on div1, and f But when the div2 appears, there is a cursor / carat at the same place, set of getcaret location (in_dive_id) and setCaretLocation (in_div_id) function. Any way to do this? Thank you -
Short answer : You < / P>
Long answer can not: The problem you are experiencing is that you will be able to get (x, y) coordinates for the event click on Div1, but the position of the carat Any implementation is required when you need to know the position of the carat in the content (which is the number of characters before the carpet).
(X, Y) coordinates the position of a character that you really should know how many letters were before (i.e. the current row and above are left if the text is ltr).
If you use a fixed width font, you can make the problem easier: coordinate on a character (X, Y) mapping (line, column) on a character grid.
However, you still face the problem of learning not to wrap the text. For example:
------------------ | Advertising | | Dollar Site AMT | | Fenecter | | ADPING Elite | , you know that the character is the first on the 2nd line, but there is no way without knowing the raping algorithm, you will know that it is the 13th character in the "Armor Drayer Seat ...". And there is no guarantee that such raping algorithms are similar in browser and platform. Now, what am I thinking, why would you use 2 different synced div
in the first place?
Comments
Post a Comment