Disable 'Right-Click' and 'Dragging Images' on Your liveBooks Website

Disable 'Right-Click' and 'Dragging Images' on Your liveBooks Website

By utilizing the Developer Tools in the liveBooks editor, you are able to disable the 'right-click' or 'context menu' for your images on the site. You can also disable the ability for users to click-and-drag your images from your website onto their computer's desktop or a folder. This is a helpful deterrent for piracy and image theft. 

 

Disable the Right-Click Function

To disable the ability for users to right-click on your site:

1. Copy the code below:

document.addEventListener('contextmenu', event => event.preventDefault());

2. Navigate to your liveBooks dashboard.

3. Navigate to your website's Developer Tools by clicking the [<>] icon on the grey navigation bar at the top of the page.

4. Click on Body JS; the link is located directly under the title Developer Tools.

5. You will see a text field. In the first available empty line (if you do not have any code here, it will be the first line in the text box), paste the code.

6. Click the blue Save button.

7. Click the green Publish button in the top-right corner of your site to publish the changes!

Screen_Shot_2020-04-21_at_11.07.40_AM.png

 

Disable the Drag-and-Drop Function

Follow the above steps 1-4 to navigate to the Body JS section of your Developer Tools dashboard. 

On a blank line in the Body JS text box, paste the below code:

$("img").mousedown(function(e){
e.preventDefault()
});

Click the blue Save button, then click the green Publish button to confirm the changes on your website.

    • Related Articles

    • Can I gain access to a website site using FTP?

      While we allow you to fully manage and design your site, it is not possible to access a liveBooks website site using FTP (File Transfer Protocol). This is due to your website and platform being proprietary to our server, as all content and images are ...
    • Website SEO Best Practices

      Search Engine Optimization (SEO) is the process of optimizing your website content to help maximize its performance in search engines and reach more users. Search engines like Google have developed highly complex algorithms that determine whether ...
    • Connect Your Ecwid Store to liveBooks

      Ecwid is a popular e-commerce service that many businesses and individuals use to sell products on their websites. There are two main steps to integrate your Ecwid Store to your website: Add an HTML Block to the desired page. Copy and embed your ...
    • Add a liveBooks Email Address to Your 'Safe Senders' List

      If you're having issues receiving certain emails - such as billing notifications or password reset links - you can add an email address to your "Safe Senders" list with a filter, or just simply add the email address to your Contacts in your email ...
    • Add a Pop-up to Your Website

      You can add a pop-up to your website by using Jotform, a third-party form builder software. When creating a form on Jotform's platform, you are not required to add any form fields; you can simply add text or images in a pop-up window to announce ...