jQuery Plugin To Prevent Saving Images From Your Website - stopStealPhoto

File Size: 3.93 KB
Views Total: 1400
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Prevent Saving Images From Your Website - stopStealPhoto

stopStealPhoto is a very small jQuery plugin that prevents saving images from your website and displays a custom alert message when the user tries to right click the images.

How to use it:

1. Include the jQuery stopStealPhoto plugin after including jQuery library.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.stopStealPhoto.js"></script>

2. Call the function on the img tag to protect all the images within the document.

$('img').stopStealPhoto();

3. Customize the alert message when you right click on the images.

$('img').stopStealPhoto({

  // custom message
  message : 'This image is protected',

  // delay in ms
  delay: 600,

  // additional CSS class
  customClass: undefined,

  // offset of cursor
  cursorOffset: 14
  
});

4. You can also specify the alert message for each image using the data-ssph attribute as this:

<img src="image.jpg" data-ssph="your text">

This awesome jQuery plugin is developed by djmansys. For more Advanced Usages, please check the demo page or visit the official website.