[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Disable page text selection and drag-and-drop in Mozilla Firefox

Posted on 2004-11-04
5
Medium Priority
?
15,060 Views
Last Modified: 2007-12-19
Dear Experts,

I need to disable drag-and-drop operations in mozilla firefox. The following works in IE:

<body ondragstart="return false" onselectstart="return false">

Is there a way to achive the same result in mozilla (I'm on linux)?
0
Comment
Question by:dda
5 Comments
 
LVL 7

Accepted Solution

by:
suramsureshbabu earned 800 total points
ID: 12493664
0
 
LVL 4

Author Comment

by:dda
ID: 12494143
suramsureshbabu,thanks for the idea. It works, but I'd like to set this property for the whole document. And if I set <body onmousedown="return false"> I can't put cursor into input field, for example...
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 600 total points
ID: 12494356
<script>
function noDrag() { return false }
function stopDrag() {
  for (i=0;i<document.links.length;i++) document.links[i].onmousedown=noDrag;
}
</script>
<body onLoad="stopDrag()">
0
 
LVL 25

Assisted Solution

by:devic
devic earned 600 total points
ID: 12494487
also here some style:
===============
<style>
.protectedText
{
    -moz-user-focus: ignore;
    -moz-user-input: disabled;
    -moz-user-select: none;
}
</style>

<input class="protectedText" type="text" value="Change this" />
<span class=protectedText>sdaf</span>
0
 
LVL 4

Author Comment

by:dda
ID: 12501647
Thanks all!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question