how do you disable the right mouse boutton

Discussion in 'PC hardware help' started by goooba, Jan 20, 2006.

  1. goooba

    goooba Guest

    how do you and if thare a url code thats what i really need!!!
     
  2. Jeanc1

    Jeanc1 Guest

    If you are talking about HTML coding for a webpage ?? Here's a two script I done to do just that :- (Paste either one [bold]BOLD[/bold] scripts between the <HEAD> tag and </HEAD> tag of your webpage.)


    [bold]<!-- Begin
    function right(e) {
    var msg = "Sorry, you don't have permission to right-click.";
    if (navigator.appName == 'Netscape' && e.which == 3) {
    alert(msg);
    return false;
    }
    if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
    alert(msg);
    return false;
    }
    else return true;
    }

    function trap()
    {
    if(document.images)
    {
    for(i=0;i<document.images.length;i++)
    {
    document.images.onmousedown = right;
    document.images.onmouseup = right;
    }
    }
    }
    // End -->
    </SCRIPT>[/bold]

    or if you prefer sending the RightClicker away use this instead:-

    [bold]<SCRIPT LANGUAGE="JavaScript">
    document.onmousedown=click
    var times=0
    var times2=10
    function click() {
    if ((event.button==2) || (event.button==3)) {
    if (times>=1) { bye() }
    alert("This Belongs To goooba Ask ME First");
    times++ } }
    function bye() {
    alert("I warned you .. but you tried again. Bye Bye :)");
    bye() }
    </SCRIPT>[/bold]


    <<The last one will warn them that goooba does'nt like it>>
    Have a great day !

     
    Last edited by a moderator: Jan 20, 2006

Share This Page