1

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?

medve.cfg
  • 89
  • 10

3 Answers3

1

Just add this to your CSS

img{
-webkit-user-drag: none;
}

That's all you need to do.

0

Use the CSS selector pointer-events. So, give it the style pointer-events: none;. Here's some more documentation on that.

Hope this helps!

kognise
  • 612
  • 1
  • 8
  • 23
0

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" />
Cedric Ipkiss
  • 5,662
  • 2
  • 43
  • 72