Reputation: 89
I am working on a carousel which is working great, the only problem is that when I drag the image, a ghosting replica hovers above the image. This also happens when I drag the image container.
I tried with draggable="false"
and also with user-select: none !important;
but none of them worked.
How can I solve this problem?
Upvotes: 1
Views: 3758
Reputation:
Just add this to your CSS
img{
-webkit-user-drag: none;
}
That's all you need to do.
Upvotes: 1
Reputation: 6337
Do something like this:
document.getElementById('drag').ondragstart = function() { return false; };
<img src="https://images.pexels.com/photos/2016999/pexels-photo-2016999.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" id="drag" />
Upvotes: 0