Wednesday, 20 February 2013

To make an Image readonly in your website

When you are dealing with photo uploading websites, You will definitely meet a requirement to make image readonly. Here iam explaining  how to make image read only b y addng single line of code....


In most cases your image code will be like this :-

<img src="imagename.jpg" alt="imagename " id="imageid">


so, Inorder to make read only you have to just add a span class and place image inside that span class.

<span oncontextmenu="return false" ondragstart="return false"> <img src="imagename.jpg" alt="imagename " id="imageid"></span>

Now you can check whether image is downloadable ... hope this works:-)



No comments:

Post a Comment