Log in

View Full Version : Making element (or its content) "unselectable"



ItsMeOnly
08-09-2006, 07:54 PM
on http://rambo.id.uw.edu.pl/fmanager.html I made a nice gizmo in form of "live" SGI-like file manager, however there is an annoying side effect that when I try to move window, or doubleclick on "items" in FM, the text is being highlighted- I'd like to avoid that: is there a possibility to make an element "unselectable"?

Twey
08-09-2006, 09:49 PM
Very nice. Good CDE look.

Have a look at the DD No Select Text script (http://www.dynamicdrive.com/dynamicindex9/noselect.htm) for an example.

ItsMeOnly
08-09-2006, 09:58 PM
In deed that was what I was looking for: onselectstart, for now I inserted DD script, however it is a little too strict, so I'm going to "reverse engineer" it and write my own, more sophisticated one :)

And BTW: it's not CDE- it's Indigo Magic Desktop aike

--added: And it's done:

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

function lockSelect() {
document.onselectstart= function() { return false };
document.onmousedown= function() { return false };
}

second called when "window" is dragged or clicable item receives mousedown event, and then first when mouseup
Can anyone test the page on IE?

Twey
08-09-2006, 11:15 PM
And BTW: it's not CDE- it's Indigo Magic Desktop aikeYeah, I read the bit about SGI after posting that. I wonder which came first?

ItsMeOnly
08-09-2006, 11:33 PM
CDE- 1986, IMD, or IRIS desktop as it was first called, came with 4D and IRIS series, around 1989/1992 (with multiple revisions which lead to final look as presented on my site).