Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Saturday, 2 April 2016

No Right Click!


Protecting your Images
1. Disable Right Click on Images only
If you really must disable right-click, then limit the aggravation and use a script that disables it on images only (some scripts also prevent the IE6 image toolbar from appearing). Of course there will be times when people want to use right-click and have their mouse over an image, so I’d recommend you change the message slightly to reflect the fact that only images are affected.
But instead you can use :-
1) Normal coding which offer you save the Image:-
 try to right click to save this image
                                                 <img src="puppy.gif" alt="Puppy" />



2) Coding which 'Never' offer you save the Image:-  
try to right click to save this image
                          <img src="puppy.gif" alt="Puppy"  oncontextmenu="return false" />



3) Coding which 'Never' offer you save the Image also show 'Alert Box' :-  try to right click to save this image 
          <img src="puppy.gif" alt="Puppy"  oncontextmenu="alert('Hi Joe'); return false" />


You can also disable all images on the particular page by :- 
 Simply add the following code to the END of your page, right above the tag:
      <script>
document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "img" || (target.tagName == 'a' && target.firstChild.tagName == 'img'))
return false
}
</script>

You can also disable all images on the particular page by :- 
Just replace your   <html>  to  <html onContextMenu="return false;">

No comments:

Post a Comment