Results 1 to 10 of 10

Thread: No Highlight

  1. #1

    Thread Starter
    Junior Member KornChild's Avatar
    Join Date
    Mar 2001
    Location
    Oklahoma
    Posts
    26

    Question 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?

  2. #2
    Fanatic Member chrismitchell's Avatar
    Join Date
    Jan 2001
    Location
    With Hobbes in New Zealand
    Posts
    568
    Try changing the onMouseClick to onMouseOver.... That will sort out one problem.

  3. #3

    Thread Starter
    Junior Member KornChild's Avatar
    Join Date
    Mar 2001
    Location
    Oklahoma
    Posts
    26

    Question 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>

  4. #4
    scoutt
    Guest
    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

  5. #5
    Fanatic Member chrismitchell's Avatar
    Join Date
    Jan 2001
    Location
    With Hobbes in New Zealand
    Posts
    568

    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...

  6. #6

    Thread Starter
    Junior Member KornChild's Avatar
    Join Date
    Mar 2001
    Location
    Oklahoma
    Posts
    26

    Question

    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!

  7. #7
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    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.

  8. #8

    Thread Starter
    Junior Member KornChild's Avatar
    Join Date
    Mar 2001
    Location
    Oklahoma
    Posts
    26
    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">

  9. #9
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Not really related, but why do you not want it to be able to be highlighted?
    Alcohol & calculus don't mix.
    Never drink & derive.

  10. #10

    Thread Starter
    Junior Member KornChild's Avatar
    Join Date
    Mar 2001
    Location
    Oklahoma
    Posts
    26
    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
  •  



Click Here to Expand Forum to Full Width