Caret.js
Get caret position or offset from inputor
This is the core function that working in At.js.
Now, It just become an simple jquery plugin so that everybody can use it.
And, of course, At.js is using this plugin too.
Live Demo
http://ichord.github.com/Caret.js/
Usage
$('#inputor').caret('position');
$('#inputor').caret('offset');
var fixPos = 20
$('#inputor').caret('position', fixPos);
$('#inputor').caret('offset', fixPos);
$('#inputor').caret('pos');
$('#inputor').caret('pos', 15);
$('#inputor').caret('offset', {iframe: theIframe});
$('#inputor').caret('position', {iframe: theIframe});
$('#inputor').caret('pos', 15, {iframe: theIframe});