BuddyBoss Home – Web Support Forums Themes BuddyBoss theme ADDING NO RIGHT-CLICK MENU

Viewing 4 posts - 1 through 4 (of 4 total)
  • Question

    #39263
    @idurston

    Hi, I have a script that disables the RIGHT-CLICK menu which is ideal as my photography site has plenty of posts with images that we don’t want ‘save image as’ option. How can I embed the script on to the temple? Currently I have to add the script to each post every time. Id like all pages ideally to disable the right-click menu.

    Is it possible?

    The script is:

    <script language=JavaScript>
    <!–

    //Disable right mouse click Script

    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>

    Answers

    #39268

    Alyssa
    Participant
    @alyssa-buddyboss

    @idurston this is definitely not a theme issue but I suggest you put this in the footer.php file in your child theme. If it is not there you may need to copy it from the parent theme.

    #39275
    @idurston

    That works a treat, thanks!!!!!!!!!!!!!!!

    #39293

    Alyssa
    Participant
    @alyssa-buddyboss

    NP

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘ADDING NO RIGHT-CLICK MENU’ is closed to new replies.