Preventing click event with jQuery drag and drop

Posted by Sasha Yanovets on Stack Overflow See other posts from Stack Overflow or by Sasha Yanovets
Published on 2009-11-20T16:25:10Z Indexed on 2011/01/01 0:54 UTC
Read the original article Hit count: 134

I have an elements on page that are draggabe with jQuery. These elements have click event wich navigates to another page (ordinary links for example).

What is the best way to prevent click from firing on dropping such element, while allowing clicking it in not drag and drop state?

I have this problem with sortable elements, but think it is good to have solution for general drag and drop.

I've solved the problem for myself. After that found that same solution exists for Scriptaculous, but maybe someone have a better way to achieve that.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery