|
|
#1 (permalink) |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
HTML/CSS- How to code for UNSELECTABLE text
Hey guys,
Q2. for today. How would I go about making text in an html page unselectable? My problem is that in this javascripted menu I've just made (see previous post), when someone clicks on the 'Menu' label, that expands/collapses the menu, if he/she clicks on it and it selects the Menu text, then the menu freezes and goes crazy (flicking collapsed and expanded really quickly). :S Now, I've seen Microsoft's 'Unselectable' attribute, but this only works in IE. Rubbish! This unselectable attribute stops this problem I have perfectly! So please if anyone knows a cross-cleint/browser solution, please post it here! Your time and help is much appreciated. KC
__________________
|
|
|
|
|
|
#2 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
maybe you should just lay an div over the text which is transparent, so the actual text is hidden and won't be selectable?
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#4 (permalink) |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
Weee bit of help please....
HTML Code:
<!--Menu Header--> <div style="STYLES" title="Expand" onClick="DO MENU STUFF">+ Menu</div> <!--//Menu Header--> I've tryed working like this: HTML Code:
<!--Menu Header--> <div style="z-index:2; "> <div style="STYLES" title="Expand" onClick="DO MENU STUFF">+ Menu</div> </div> <!--//Menu Header--> Any ideas? Thanks in advance.
__________________
|
|
|
|
|
|
#5 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
hmmm, without position:absolute I think it'll be a hard task...
Maybe it makes more sense to fix why the menu goes crazy if you select the text. Is there a listener for that object active? Can't you reduce that to only the + or - or something?
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#6 (permalink) |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
Hmmm I'll look into this, but really no one got any other ideas for just making the text unselectable?
I find it hard to believe there hasnt been a standardised method of doing this... ...but oh well, c'est la vie!
__________________
|
|
|
|
|
|
#7 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
I still like to know why it does it, because making text unselectable is really unportable, and unliberal too.
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|