How do I do this with images?

5 replies
  • WEB DESIGN
  • |
I have an image that I don't want to be able to be saved. So when they right click it, it can't be saved.

How do I do this? I know godaddy has a badge that can't be saved.

Any help is appreciated
#images
  • Profile picture of the author thinkweb
    not sure if this will help you but I think your are looking for this..

    Code:
    <script language=JavaScript>
    <!--
    
    //Disable right mouse click Script
    //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
    //For full source code, visit http://www.dynamicdrive.com
    
    var message="Function Disabled!";
    
    ///////////////////////////////////
    function clickIE4(){
    if (event.button==2){
    alert(message);
    return false;
    }
    }
    
    function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
    alert(message);
    return false;
    }
    }
    }
    
    if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
    }
    else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
    }
    
    document.oncontextmenu=new Function("alert(message);return false")
    
    // --> 
    </script>
    hope it helps..

    -Roland
    Signature
    Passionate about Life :)
    You always succeed in producing a result. The real question is how do we help each other produce great results?
    {{ DiscussionBoard.errors[2083650].message }}
  • Profile picture of the author ninal
    One solution would be to have a transparent overlay over the image (a blank gif). You can have this implemented via simple html/css. But looking at your source code would reveal the image path unless you create each image as background image.

    here's a similar idea with a tutorial.
    Signature
    Hello
    {{ DiscussionBoard.errors[2083815].message }}
  • Profile picture of the author Social Experts
    Thanks for your replies I was actually hoping for an html code because I am going to be giving this image to websites and I don't want people to be able to save it.
    Signature

    Chill.

    {{ DiscussionBoard.errors[2083960].message }}
  • Profile picture of the author stevecane
    Add this code to the 'header' section of your page:

    "<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
    <script language="JavaScript">
    function noRightClick() {
    if (event.button==2) {
    alert('You may not right mouse click this page.')
    }
    }
    document.onmousedown=noRightClick
    </script>"

    That should do the trick...

    S
    Signature
    Evening Wear Dresses - Bring Out Your Inner Princess

    Crystal Table Lamps - Transform Your Home

    Turbo Training - Get Bike Fit
    {{ DiscussionBoard.errors[2084717].message }}
  • Profile picture of the author Social Experts
    Dude thanks that works perfectly
    Signature

    Chill.

    {{ DiscussionBoard.errors[2084820].message }}

Trending Topics