Results 1 to 2 of 2

Thread: Disable right click image menu only with message

  1. #1
    Join Date
    Jun 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Disable right click image menu only with message

    I've been using the Disable right mouse click script that I can't seem to find here right now...but it completely disables right click...

    works great....and I know there are ways around it...not the point...but:

    It is interfering with our shopping cart customers who try and repeatedly cut and past their info to fill out forms wreaking havoc on some impatient customer's patronage - so I'm going back to:

    Disable right mouse click script II (on images) HOWEVER, it is very annoying that after the message, in Firefox especially, the "save image as" menu still pops up like a grand invitation to ignore the request not to copy. (We have competitors who use the same vendors who tell us they did not see any indication that our product images were our own...so the other script has really worked for us and they don't copy anymore.)

    Is there a script that can pop the message up on right click to not copy but not allow the right click menu to follow JUST ON IMAGES...so it doesn't interfere with our forms?

    I've tried using a combo of the disable right menu script and the disable image script but the issue of general cutting a pasting is still there.

    Thanks to any links for such a script.

  2. #2
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,524
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    The no right click on images works for me. It displays an alert box if you right click on an image but not on the background. I use internet explorer and it dosen't display the right click menu.

    HTML Code:
    <script language="JavaScript1.2">
    
    /*
    Disable right click script II (on images)- By Dynamicdrive.com
    For full source, Terms of service, and 100s DTHML scripts
    Visit http://www.dynamicdrive.com
    */
    
    var clickmessage="Please do not copy 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>
    Is that what you want?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •