Can I disable 'Right-Click' on my liveBooks site?

liveBooks Support

by utilizing the HTML content block feature in the liveBooks editor, you are able to disable the 'right-click' or 'context menu' for your images on the site. This is a helpful deterrent for piracy and image theft. 

*To learn how to use the HTML content block on liveBooks, click here.

 

--


To add this feature site-wide, please do the following:

  • Go to Content
  • Under Global Content, select Footer

Screen_Shot_2017-04-18_at_8.27.27_AM.png

  • Create an HTML content block within the footer.

Screen_Shot_2017-04-18_at_8.31.47_AM.png

  • Add the following HTML snippet to the HTML content block you created:

<script type="text/javascript">
//<![CDATA[
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable context menu on images by GreenLava (BloggerSentral.com)
Version 1.0
You are free to copy and share this code but please do not remove this credit notice.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
function nocontext(e) {
var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
if (clickedTag == "IMG") {
alert(alertMsg);
return false;
}
}
var alertMsg = "Image context menu is disabled";
document.oncontextmenu = nocontext;
//]]>
</script>

 

If you wish to only add this feature to a specific page, follow these instructions:

  • Go to Content
  • Click into the Page you wish to add this feature to
  • Create an HTML content block to this page

Screen_Shot_2017-04-18_at_9.05.32_AM.png

  • Add the following HTML snippet to the HTML content block you created:

<script type="text/javascript">
//<![CDATA[
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable context menu on images by GreenLava (BloggerSentral.com)
Version 1.0
You are free to copy and share this code but please do not remove this credit notice.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
function nocontext(e) {
var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
if (clickedTag == "IMG") {
alert(alertMsg);
return false;
}
}
var alertMsg = "Image context menu is disabled";
document.oncontextmenu = nocontext;
//]]>
</script>

 

The results should look something like this! 

Screen_Shot_2017-04-18_at_9.08.49_AM.png

 

 

Note: You can replace the message 'image context menu is disabled' to whatever you like in the code above. If you prefer not to show the alert box, just delete this portion of the code:

alert(alertMsg);
return false;
}
}
var alertMsg = "Image context menu is disabled";