Protect the content and images using JavaScript and CSS
Many time, we have write a good article with some
good images .but we will after some time anyone do the same content and images . So we need to protect with right
key disable and we can protect image with drag and drop.
Java
script:-
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script
type="text/javascript">
$(document).bind("contextmenu",
function (e) {
e.preventDefault();
});
</script>
CSS
code:-
<style>
img {
pointer-events: none;
}
</style>
Protect the content and images using JavaScript and CSS
Reviewed by NEERAJ SRIVASTAVA
on
8:12:00 PM
Rating:
No comments: