image download

  edee66 11:19 03 Aug 2005

I am aware it is difficult to stop people downloading images from your website. However I believe you can use tags to at lest deter it to a point. Where can I get the instuctions for this please?


  harristweed 13:17 03 Aug 2005

I once read that a good way to stop the 'right click save picture as...' is to create a table and have your image as a background image for a cell in the table.
In the same table cell position a 1x1 pixel transparent gif. Set the size to fill the table cell i.e. same dimensions as the background image

Then all the right click will save is a transparent gif!

  edee66 15:03 03 Aug 2005

thanks Harris will try that when I get my head around it :)

  Forum Editor 17:52 03 Aug 2005

at the end of your page - above the </body> tag:-

<script language="JavaScript1.2">

var clickmessage="Right click disabled on images!"

function disableclick(e) {

if (document.all) {

if (event.button==2||event.button==3) {

if (event.srcElement.tagName=="IMG"){


return false;




else if (document.layers) {

if (e.which == 3) {


return false;



else if (document.getElementById){

if (e.which==3&&"IMG"){


return false




function associateimages(){




if (document.all)


else if (document.getElementById)


else if (document.layers)



  edee66 19:40 03 Aug 2005

Thats a lot of characters Ed but I think its the kind of thing I was thinking of. If I put it on the index page will it work for all?


  Forum Editor 23:49 03 Aug 2005

you'll need to include the code on each html page if you want to protect images on that page.

Please understand that this is no more than a fairly strong deterrent - if someone really wants your image they'll get it. Personally I prefer to watermark important images to protect them.

  edee66 12:28 04 Aug 2005

Thanks Ed, you know what my next question is don't you.... watermark?


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

Alice Saey's mesmerising animation for Dutch singer Mark Lotterman

iPad Pro 10.5in (2017) review

Comment booster votre iPhone ?