views:

139

answers:

1

I am wondering how those drag and drop widgets cancel text selection in the dragging element and other elements in the page. I tried the following code which works in IE8 (cannot select text) but does not work (can still select text) in Firefox.

<!DOCTYPE html>
<html>
<body>
  <p>Hello World</p>
  <script type="text/javascript">
    document.onmousemove = function() {
      return false;
  }
  </script>
</body>
</html>
+2  A: 

Or, analagous to your IE8 solution for Moz:

document.body.style.MozUserSelect="none"
Matthew Smith