Reputation: 50832
I just found out that getBoundingClientRect() is a great function and provides what i need (in order to calculate the line of my caret in a contenteditable div). Unfortunatly the function does not exist for safari on ipad. What can i do to get the data getBoundingClientRect() provides?
Upvotes: 0
Views: 1374
Reputation: 6825
since you tagged it jquery, may I suggest looking at offset
?
edit: I misread your question, so here some code to hopefully help you anyway:
$(document).ready(function() {
$('#myid').keyup(function() {
console.log('press');
var sel = window.getSelection();
console.log(sel);
console.log(sel.focusOffset);
});
});
Upvotes: 1