The following scenario: when you select text on iOS Safari (allows you to accept a โnormalโ html page), a blue overlay appears indicating that you have selected a specific passage. In addition, you can change this selection to correct your initial selection area. I am interested in recording this particular event when a change in the selection area is made. Is it possible (when yes, how?) To catch such an event in Javascript? thanks in advance.
Mobile Safari supports the selectionchange event, which fires on Document nodes:
selectionchange
Document
document.addEventListener("selectionchange", function() { alert("Selection changed!"); }, false);
I found that this event fires several times even when a single word is selected (with a tap), and, of course, it fires when you drag selection handles ...
I created a small workaround to get only the text selection end event.
you can see here : End of text selection event?
or in a short post on my blog : http://www.dimshik.com/end-of-text-selection-event-on-ios-workaround/