How to avoid any image from dragging effect ? very easy just use these methods as given bellow -
Method 1 -
Suppose your image code is :
<img src="11.png" alt="11.png" title="11.png">
Add draggable attribue and your code will be -
<img draggable="false" src="11.png" alt="11.png" title="11.png">
( Not working use 2nd method )
Method 2 -
Suppose your image code is :
<img src="11.png" alt="11.png" title="11.png">
Add ondragstart event and your code will be -
<img ondragstart="return false;" src="11.png" alt="11.png" title="11.png">
Suppose your image code is :
<img src="11.png" alt="11.png" title="11.png">
Add onmousedown event and your code will be -
<img onmousedown="return false;" src="11.png" alt="11.png" title="11.png">
( Not working use Last & combined method )
Combine All and it will works every time -
Suppose your image code is :
<img src="11.png" alt="11.png" title="11.png">
Add all attribute & events and your code will be -
<img draggable="false" ondragstart="return false;" onmousedown="return false;" src="11.png" alt="11.png" title="11.png">
Demo :
1. Draggable :
2. Non-Draggable :
very nice
ReplyDelete