i am trying to disable image drag on my website, like when i go to preview or live part of my website you can drag images from website into photoshop or whatever, i want to prevent this from happening to protect my logo or other images. please anyone?
maybe add the onmousedown and return false, havent tried it
Hi Austin,
It’s not possible to disable drag event with the Image element.
However, You can create an HTML component with img element and add draggable=“false” attribute.
It works.
Here is a sample:
<!DOCTYPE html>
<html lang=en>
<meta content="width=device-width">
</head>
<body>
<div>
<img src="https://i.ytimg.com/vi/SfLV8hD7zX4/maxresdefault.jpg"
draggable="false"/>
</div>
</body>
</html>
Good luck!
Roi
Hello Roi,
How would i get the url src of the image on my site to be able to do this?
Hi again,
Go to image uploads, Choose a picture, Hover the plus sign and open the image in a new tab.
In the new tab you will have the url to the image.
Good luck!
Roi