Closed Thread Icon

Topic awaiting preservation: Stopping text selection in Opera (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25762" title="Pages that link to Topic awaiting preservation: Stopping text selection in Opera (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Stopping text selection in Opera <span class="small">(Page 1 of 1)</span>\

 
BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 05-14-2005 17:30

Can anyone shed any light on how I would stop text from being selected in Opera?

I'm more than happy to use JavaScript for this, but if it can be done in HTML or CSS, then I'll be equally as happy ;o)

I can stop it in IE, FF, NN, and even Safari by using:

code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="en" />
<title>Test</title>

<style type="text/css">
#unselectable {
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
}
</style>
</head>
<body onload="document.getElementById('unselectable').onselectstart = function() { return false; };">
<div>This text should be selectable</div>
<div id="unselectable">This text should not be selectable</div>
</body>
</html>



but I'm just unable to stop it in Opera.

The only thing I can think of is to place a floating layer above the text, but I really don't want to do that if I can avoid it.

Thanks!
Dan

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 05-14-2005 18:00

...exactly what is the point of that?

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 05-14-2005 18:22

that is indeed a problem!
i also had this once and couldnt find a solution for opera. i also tried javascript stuff like:

document.onmousedown=function(e) {
return true;
};

but without success.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-14-2005 19:57

reisio: if you have a text-filled span (for example) that's clickable, the user might inadvertantly select the text instead of clicking, which screws everything up.

---
Website

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 05-14-2005 22:59

how does it screw everything up...isn't the span clicked regardless?

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-16-2005 01:11

Well, the biggest problem is that it A) is unexpected, and B) defeats the illusion that you're clicking a button. From a human interface perspective, these are unacceptable.

---
Website

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 05-16-2005 04:03

I gotta go with reisio here... this is normal functionality we're talking about here.

Although Billy hasn't actually mentioned why he needs this, so it may be something different.

___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 05-18-2005 15:43

This is for a project I'm working on where the selection of text would actually be a bad thing in context. I have a lot of drag and drop code, and in Opera, text is being selected while dragging... and I just cannot stop it.

I'm open to all ideas that may help solve this... so keep 'em coming

Thanks,
Dan

(Edited by BillyRayPreachersSon on 05-18-2005 15:45)

« BackwardsOnwards »

Show Forum Drop Down Menu