In this article i am going to explain how to disable right click on image using jQuery.Disable right click function is used to avoid copying images,websites and codes.
Please share your comments and feedback.Thanks.Please subscribe my updates via email.
Live DemoDownload Script
contextMenu is used to trigger contextMenu with right-click, left-click, hover or own custom trigger events.
Step 1:
Need library function.Just copy and paste the below library file.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
contextMenu is used to trigger contextMenu with right-click, left-click, hover or own custom trigger events.
Step 1:
Need library function.Just copy and paste the below library file.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
jQuery Function
$(function() {
$('img').bind("contextmenu", function() { //It works for all img tags.
return false
});
});
$('img').bind("contextmenu", function() { //It works for all img tags.
return false
});
});
HTML code for disable right click
<img src="your-img.jpg" alt="img" />
No comments:
Post a Comment