1. I've started a massive SPAM purge, any accounts that have spammed are being removed, also for a short period new user signups are disallowed until the SPAM cleaning is finished.

How to disable right click on images?

Discussion in '(X)HTML / CSS' started by Rahul, Nov 13, 2008.

Thread Status:
Not open for further replies.
  1. Rahul

    Rahul Love

    Joined:
    Sep 5, 2008
    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    Is there any simple or easy way to disable right click on images?

    I searched on Google but found some very long codes to insert to disable the right click :(

    Thanks for your help.
    Loading...
  2. Mr Justin

    Mr Justin <B>Moderator</b>

    Joined:
    Sep 17, 2008
    Messages:
    486
    Likes Received:
    1
    Trophy Points:
    0
    Hi there Rahul

    Just ad the following to your Html code

  3. Rahul

    Rahul Love

    Joined:
    Sep 5, 2008
    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    Perfect :)

    Thank you very much Justin.

    Also, do you know is there any disadvantage of disabling right click using this code?

    SEO related, Site loading speed or any other kind of disadvantage?
  4. Bhuntay

    Bhuntay New Member

    Joined:
    Sep 10, 2008
    Messages:
    328
    Likes Received:
    1
    Trophy Points:
    0
    But still the visitors can check the source from view source option from the Browsers standard toolbar and that would be just annoying your users.
  5. Mr Justin

    Mr Justin <B>Moderator</b>

    Joined:
    Sep 17, 2008
    Messages:
    486
    Likes Received:
    1
    Trophy Points:
    0
    Not from the code that I have given. it disables all source code options.
  6. Bhuntay

    Bhuntay New Member

    Joined:
    Sep 10, 2008
    Messages:
    328
    Likes Received:
    1
    Trophy Points:
    0
    It only disabled right clicking, I checked the view source code and it lets me view the source code, I tested this on Safar, IE, Mozilla, Opera.
  7. mojopanel

    mojopanel New Member

    Joined:
    Dec 12, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    incript your code ( image code witht hat pice of code ) with iwebtool
    iwebtool.com/html_encrypter
  8. jerico

    jerico New Member

    Joined:
    Feb 18, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    This novel trick will disable mark/copy/paste in recent popular browsers and again, it is also fairly straightforward. Stopping those users that are using a Microsoft browser, v5 onwards or a Netscape browser, v6 onwards or any browser in the same family including Mozilla and Firefox can be accomplished using the following Markup or JavaScript script.

    Add these attributes to the BODY Tag to disable copy/paste everywhere on the page ...
    Code (Text):

    <body ondragstart="return false" onselectstart="return false">
     
    or better still add this script to the JavaScript section in the HEAD of your page ...
    Code (Text):

    document.body.ondragstart = "return false";
    document.body.onselectstart = "return false";
     
  9. GordyMac

    GordyMac New Member

    Joined:
    Jan 21, 2009
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    0
    Not to knock ya but there are many ways to get anything and everything from a website so doing this, as said above, could potentially just annoy visitors..
  10. uptonormal

    uptonormal New Member

    Joined:
    May 1, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    0
    Anything shown on the website can be taken, i guess.

    Can anyone give me some site which has disabled all these, I would like to test it. :)
  11. druss

    druss New Member

    Joined:
    Jul 9, 2009
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    0
    No right click is pointless in my opinion. If someone really wants to get your images they will get them.

    Have you considered using a watermark?
  12. gold

    gold New Member

    Joined:
    Jul 9, 2009
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    0
    The disadvantage of using the below method is that it takes just seconds to reverse. You can just set those varaibles to their default values by pasting the javascript in the address bar.

    In my experience, the best way to protect images (not perfect like any other method) is to use css files and have the image being displayed as a background to a div. Most people won't know how to get that image.

  13. Matt

    Matt The Sexy Admin

    Joined:
    Jun 5, 2009
    Messages:
    211
    Likes Received:
    0
    Trophy Points:
    0
    More people than you think will know how to pull up source & get the css file and in extension the file. There is no foolproof way of stopping people taking your content, if you cant beat them - join them by having a CC license on your content :)
  14. gold

    gold New Member

    Joined:
    Jul 9, 2009
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    0
    like I said Matt, no method is perfect. I have worked close with web-designers and I know many people tend not to know how to get an image behind a css file compared to those who don't know how to view the source and extract an image.

    Chances are that if you know how to get the image from the css you most likely know how to view-source the web page and get the image src. Things aren't the same in reverse. This means if you know how to view the source of a web page this doesn't necessarily mean that you know that the image location could be located in the css.

    CC license is the ultimate solution indeed. But webmasters usually don't want to go there.
  15. strauss01

    strauss01 New Member

    Joined:
    Jan 11, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    Thanks, for good solution.:)
Thread Status:
Not open for further replies.

Share This Page