image download

  edee66 11:19 03 Aug 2005
Locked

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?

Thanks

  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"){

alert(clickmessage);

return false;

}

}

}

else if (document.layers) {

if (e.which == 3) {

alert(clickmessage);

return false;

}

}

else if (document.getElementById){

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

alert(clickmessage)

return false

}

}

}

function associateimages(){

for(i=0;i<document.images.length;i++)

document.images[i].onmousedown=disableclick;

}

if (document.all)

document.onmousedown=disableclick

else if (document.getElementById)

document.onmouseup=disableclick

else if (document.layers)

associateimages()

</script>

  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?

Thanks

  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?

Thanks

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

Elsewhere on IDG sites

Best Black Friday Deals 2017

How modern book design was influenced by illustrated manuscripts

Best Black Friday Apple Deals 2017

Les meilleurs logiciels de montage vidéo gratuits (en 2017)