Is it possible to drag an HTML element out of another element and trigger a change with jQuery?

Posted by blackrobot on Stack Overflow See other posts from Stack Overflow or by blackrobot
Published on 2009-09-16T18:09:09Z Indexed on 2010/04/07 8:13 UTC
Read the original article Hit count: 202

Filed under:
|
|

I have a container element that you can drag objects around in. I want it it so that if you drag an element out of the container (when the mouse crosses the border of the containing div) the element you're dragging to change. How do I arrange this?

$("#container img").draggable({
    helper: 'clone',
    zIndex: 100
});

Once the image crosses the bounds of "#container" I should be able to change the image source.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript