Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Disable IE10+ Touch Text Selection

$
0
0

On the "Make your site touch-ready" page, the following info and code is given to disable touch text selection of a particular element. How can I apply this to the entire page?  I've tried using body or document for the element without success.

I'm not sure if I have my jquery syntax correct, but I also tried this to apply it to all <H3> tags in my DOM:

$("h3").addEventListener("selectstart",function(e) { e.preventDefault(); }, false);

Unfortunately this didn't work either. Any ideas?  My site has some excellent UI but touching some of the text to interact with the UI causes the browser to select the word.

Info from cited page: 

Touch selection

You can select a word using touch in Internet Explorer 10 by tapping on or near text. If you want to disable text selection, do it just like you did in Windows Internet Explorer 9.

element.addEventListener("selectstart", function(e) { e.preventDefault(); }, false);// Disables selection

Shawn Keene



Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>