image download

  edee66 11:19 03 Aug 05
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 05

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 05

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

  Forum Editor 17:52 03 Aug 05

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 05

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 05

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 05

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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…