Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Abd
    Abd is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Lagos, Nigeria
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Disabling Right Click Mouse

    Hi all,

    please does anyone knows how to write a script that will disable right clicking on a web page?

    Abd
    Abdul

  • #2
    New Coder
    Join Date
    Dec 2002
    Location
    Florida
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <script language=JavaScript>
    <!--

    //Disable right mouse click Script
    //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
    //For full source code, visit http://www.dynamicdrive.com

    var message="Function Disabled!";

    ///////////////////////////////////
    function clickIE4() {
    if (event.button==2) {
    alert(message);
    return false;
    }
    }

    function clickNS4(e) {
    if (document.layers||document.getElementById&&!document.all) {
    if (e.which==2||e.which==3) {
    alert(message);
    return false;
    }
    }
    }

    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
    } else if (document.all&&!document.getElementById) {
    document.onmousedown=clickIE4;
    }

    document.oncontextmenu=new Function("alert(message);return false")

    // -->
    </script>



    You can get these anywhere. This one was from dynamicdrive.

    MrDoubtFire

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,649
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Left-handers love those...
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Abd,
    once you learn more about web design, coding and the like.
    you will realize that you wont need or want a no right click script

    if you continue extending your knowledge on the whole web coding thing, you will find that time will have proven me right.

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #5
    New Coder
    Join Date
    Oct 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have to agree...

    When I first started all I wanted to do was protect images....

    You soon find out it is useless and makes people more persistent!!

  • #6
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by BusterLee

    You soon find out it is useless and makes people more persistent!!
    haha your exactly right, when i see someone using waaay to many novelty javascripts to protect there pages, i just want to grab the source and email it to them

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #7
    New to the CF scene
    Join Date
    Dec 2002
    Location
    Pennsylvania (the black hole)
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    There's always Alt-PrtScrn

    There is no way to truly protect images, or anything else online for that matter. There's always going to be someone ahead of the game who will figure a way around it.
    How can I love building websites so much when they frustrate the crap out of me?


  •  

    Posting Permissions

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