I’m using jQuery to drag items around. The items have click events. I’d like to register clicks where the user moves the mouse a little while the button is still down, so, using mouseup instead of click is the obvious answer, but! I need to use helper: ‘clone’ on drag, because items are in a container set to overflow: scroll (or auto) and I need to drag(/drop) outside of that container.
So the question is, is there a way to register a mouseup event on the clone?
I’d also need access to the original item – for a colour change, let’s say.
Here’s an example: http://jsfiddle.net/kFBtr/
Thank you.
Yes, using delegate or live, something like this:
To access the original element, just use prev:
Example: http://jsfiddle.net/kFBtr/1/