on-internet
← Community

How do I add a link to a draggable element that doesn't open when you drag it, only when you click it?

Stack Overflow ·

The drag works just how I'd like it to, but I'd like it not to trigger open link when dragged. I've tried fiddling around with my little knowledge of JavaScript, however I just can't seem to get it to work how I'd like it to. Here's the code I'm working with: // here you tell InteractJS which class of items you'd like to be draggable interact('.draggable') .draggable({ listeners: { // when a user drags the object ('on dragmove') run this function move: dragMoveListener, // call this function on every dragend event end (event) { console.log("item dropped!") } } }) function dragMoveListener (eve

Comments

Sign in or sign up to comment and upvote.

No comments yet.