39 users online (0 members and 39 guests)  


  Results 1 to 2 of 2

Related

  1. Hi people    Forum: General Discussion
    Replies: 3
  2. Hi there people!    Forum: General Discussion
    Replies: 2
  3. Hey People    Forum: Introduce Yourself
    Replies: 1
  1. #1
    Guest
    Guest's Avatar
    Guest

    Question How do i make it so people can't right clik?

    i am trying to make a website but i don't want people taking my pictures. what is the "code" so people cannot right-click? please email me at SunStorm2989@aol.com

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Post

    Keep in mind, that this script does not stop the user from saving images. Heck, once they view the page then the page and all of its content is already on the users harddrive. The user can also just use the top browser menu to do anything that is disabled with the no right click.



    -----place this in the <head> of your file-----
    <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>
    ----------

    Good luck,

    Dave

    [This message has been edited by Dave (edited 07-12-2001).]



Tags for this Thread