How to not show drop down on right click?

Discussion in 'JavaScript' started by bobby9101, Jun 26, 2007.

  1. #1
    Hi, I don't want that little menu (the browser one, that has copy, past, etc:) to drop down when i right click on my page.
    I have seen sites that have it disabled, how do I do that?
     
    bobby9101, Jun 26, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Search Google for "disable right mouse click", and just remove the alert() line from the code (if any). This should do it...
     
    nico_swd, Jun 27, 2007 IP
  3. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
  4. Morli

    Morli Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Use this javascript code...

    <SCRIPT TYPE="text/javascript">
    <!--
    //Disable right click script
    //visit rainbow.arch.scriptmania.com/scripts/
    var message="Sorry, right-click has been disabled";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    document.oncontextmenu=new Function("return false")
    // -->
    </SCRIPT>

    Source: rainbow.arch.scriptmania.com/scripts/no_right_click.html

    Cheers,
    Mohsin
     
    Morli, Nov 3, 2008 IP
  5. ranabra

    ranabra Peon

    Messages:
    125
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    just in case... remember that if you plan to not enable people get your source code or copy a picture it is on the long run, impossible. it would be sucessfull for complete noobies but that's about it.
     
    ranabra, Nov 3, 2008 IP