javascript - removeAllRanges() in Internet Explorer -


I am writing drag and drop script when the problem is pressed and it moves forward with the page, this lesson Starts selecting. I got a way to stop it by calling ...

  var selection = window.getSelection (); selection.removeAllRanges ();   

... As always when I move the mouse, I'm having trouble with Internet Explorer.

Thanks in advance!

The entire selection model is completely different in the old IES is. There is no modern browser like any window.getSelection () and range objects. You have to be familiar with IE. IE and lieutenant; Selection and implementation of categories in 9.

However, your problem with IE can be solved in a simple way. Attach the onselectstart event to window (or any element you need). Stop the default action in a handler and cancel bubbling. Something like this:

  window.attachEvent ('onselectstart', function (e) {e.returnValue = false; e.cancelBubble = true; return false;}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -