|
-
May 6th, 2001, 04:00 PM
#1
Thread Starter
Junior Member
No Highlight
I have a drop down menu setup on my webpage using javascript and everytime you click it highlights everything cause u accidently drag. Is there a way to make it so the user cannot highlight or drag over text?
-
May 6th, 2001, 04:25 PM
#2
Fanatic Member
Try changing the onMouseClick to onMouseOver.... That will sort out one problem.
-
May 6th, 2001, 05:28 PM
#3
Thread Starter
Junior Member
Code
Here is the menu code I am using, if I use mouseover the menu comes down everytime the mouse is over the text, I just want it so the user can't highlight the text, if that is possible, otherwise id like it so its not as easy to highlightit, whichever works best. Thanks for everyones help.
<script language="javascript">
<!--
function preload(){}
function showhide(what,what2){
if (what.style.display=='none')
{
what.style.display='';
}
else
{
what.style.display='none'
}
}
-->
</script>
</head>
<span id="menu1" onClick="showhide(Downloads)" style="cursor:hand">
<span id=""><span style="color : #ff0000"
onmouseover="this.style.color='800000'" onmouseout="this.style.color='#ff0000'">Downloads</span>
-
May 7th, 2001, 01:53 AM
#4
I think you might have missed something. I noticed that you forgot a # next to 800000.
Code:
<span id=""><span style="color : #ff0000"
onmouseover="this.style.color='#800000'"
onmouseout="this.style.color='#ff0000'">Downloads</span>
try that and see if it works. other than that I have no idea as the code looks good.
Scoutt
-
May 7th, 2001, 03:48 AM
#5
Fanatic Member
Re: Code
Originally posted by KornChild
<span id="menu1" onClick="showhide(Downloads)" style="cursor:hand">
<span id=""><span style="color : #ff0000"
onmouseover="this.style.color='800000'" onmouseout="this.style.color='#ff0000'">Downloads</span>
I agree with scoutt on the # missing from the 800000 on the "onmouseover". As for the rest its to do with the "onClick" try changingit to an onOver (or nearest equivelant) to get rid of the box when you activate the buttons. I hope that helps a bit... If I didn't help I'm sure that Mark Sreeves will, he knows a hell of alot more about JavaScript than I do...
-
May 7th, 2001, 03:07 PM
#6
Thread Starter
Junior Member
Sorry I must have worded my question weird. I just want to know how to make it so the viewer of my page CanNot highlight (drag over) text on my site, so the text cannot be highlighted. Other than that my code works perfect for me. Thanks for everyones help so far!
-
May 7th, 2001, 04:44 PM
#7
Fanatic Member
Not sure which span is which, but try this n the one you don't want highlighted:
Code:
<span id="something" onFocus="this.blur();">
Alcohol & calculus don't mix.
Never drink & derive.
-
May 7th, 2001, 05:46 PM
#8
Thread Starter
Junior Member
Thanks!!! that worked perfect for my normal links! is there a way to make this fake link do the same?
I have it setup as a javascript drop down menu. This is one of the headers and you click it and links drop down, is there a way to make this not highlightable too?
<span id="menu1" onClick="showhide(Downloads)" style="cursor:hand">
-
May 8th, 2001, 05:45 PM
#9
Fanatic Member
Not really related, but why do you not want it to be able to be highlighted?
Alcohol & calculus don't mix.
Never drink & derive.
-
May 8th, 2001, 07:26 PM
#10
Thread Starter
Junior Member
no reason really, well so I can know how to in the future. but mainly because its more convient for whoever is using the page cause it doesnt highlight everything when you try to click or open a menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|