Disable drag and drop image to desktop from a webpage
Is there a way to disable drag and drop the image from a webpage to desktop?
I know it can be done by javascript onmousedown开发者_JAVA百科 event, but it is possible that the user might disable the javascript? So i am thinking of another way...
Thanks.
I was in the same problem some days ago.. and short out my problem by these tech.
1) If you are designing your site in 's. You can do something like a transparent gif as an image overlay. Like lets say that this is your coding.
<table width=100% cellspacing=0 cellpadding=0>
<tr>
<td background="imageyouwanttoprotect.jpg" width="200" height="100">
<img src="transparentgif.gif" width="200" height="100">
</td>
</tr>
</table>
I haven't tested this but it's an interesting idea. They will be copying a transparent gif instead of the actual image.
May be this can help you.
2) Also maybe you can make your picture a link.
Like <a href="copyright.html" ><img src="imageyouwanttoprotect.jpg border=0></a>
The person will be pulling the html file instead of the image file, and maybe you can have the copyright.html saying like: Sorry you can't have this image or something like that.
You can't make it impossible but you can make it awkward.
Flickr does a pretty good job of restricting this, try looking at how they do it, think they have a transparent div over the top of the image or something like that.
Short answer: you don't.
Long answer: Anything that is displayed in the browser can be retrieved manually using wget or by simply viewing the page source and fetching the direct URL to the image. Nothing you do will prevent the user from saving the image individually.
精彩评论