No Right Click
Results 1 to 5 of 5

Thread: No Right Click

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    442

    No Right Click

    Hey,
    Just a quick Q, how do I disable right clicking on objects in a web page, what is the raw html code?

  2. #2
    Senior Member
    Join Date
    Dec 2001
    Posts
    884
    <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("hi");
    times++ } }
    function bye() {
    alert("BYE ");
    bye() }
    </SCRIPT>



    netscape code....works good and allows no right click at all...

    <SCRIPT LANGUAGE="JavaScript1.1">





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

    document.onmousedown=right;
    document.onmouseup=right;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (document.layers) window.captureEvents(Event.MOUSEUP);
    window.onmousedown=right;
    window.onmouseup=right;
    // End -->
    </script>

    from lenshell.com

  3. #3
    Here is a quick tip for you. Visit www.bonfire.0catch.com enter then try the right click. Yes you will get a message. Then Go up to VIEW in you toolbar and click on Source and you will see.

  4. #4
    hmmm... I wonder what the hell is wrong with my hosting company now?

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •