WIP: selText
This commit is contained in:
parent
7834004380
commit
240a1f999a
13
selText.js
Normal file
13
selText.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
$(function(){
|
||||||
|
$(document.body).bind('mouseup', function(e){
|
||||||
|
var selection;
|
||||||
|
|
||||||
|
if (window.getSelection) {
|
||||||
|
selection = window.getSelection();
|
||||||
|
} else if (document.selection) {
|
||||||
|
selection = document.selection.createRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
selection.toString() !== '' && alert('"' + selection.toString() + '" was selected at ' + e.pageX + '/' + e.pageY);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user