Reputation: 1501
I have a set of images, say 9 in a 3x3 grid. I want users to mouse down on an image and drag it to another image within the grid to "Swap" or to drag it in-between two images to insert at point.
All's fine in IE, Chrome, FF, Safari. Opera though still shows the opaque "Preview" of the dragged image which I have successfully suppressed in all other browsers using return false
for the ondragstart
event. Also the image Opera returns is offset to the right by 100px
or so, probably something to do with my CSS.
However, I don't care about people copying my images, this is to provide functionality. I need the opaque drag not to show in Opera.
Upvotes: 0
Views: 329
Reputation: 26
If you're using html5 d'n'd there's no way to prevent the drag feedback to show (the spec does not specify any at least IINM). You may want to call data transfer's setDragImage() and set the image to something neutral, though.
Upvotes: 1
Reputation: 26
Is it possible for you to provide HTML, CSS and JS you are using? Do you handle d'n'd yourself or want to use HTML5 d'n'd (from 'return false' in ondragstart fragment I take you do it on your own as it seems you cancel ondragstart which cancels html5 d'n'd)? If you used addEventListener() to register for ondragstart you need to call preventDefault() to cancel d'n'd instead.
Upvotes: 0