friendica-addons/jappixmini/jappix/js/jquery.textrange.js

15 lines
456 B
JavaScript
Raw Permalink Normal View History

2012-04-17 23:12:24 +00:00
$.fn.selectRange = function(start, end) {
return this.each(function() {
if (this.setSelectionRange) {
this.focus();
this.setSelectionRange(start, end);
} else if (this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
});
};