# Revert after dropping a draggable, only if out of bounds

**URL:** <https://www.ruby-forum.com/t/revert-after-dropping-a-draggable-only-if-out-of-bounds/72230>\
**Category:** Ruby\
**Created:** [October 15, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/revert-after-dropping-a-draggable-only-if-out-of-bounds/72230 "2006-10-15T21:18:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@jrun](https://www.ruby-forum.com/u/jrun)\
**Post date:** [October 15, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/revert-after-dropping-a-draggable-only-if-out-of-bounds/72230/1 "2006-10-15T21:18:50Z")

</div>

Hi, I have a div tag as a â??containerâ? for all my draggable objectsâ?¦ My  
goal is to be able to decide whether to revert these objects based on  
where they are dropped. If they are â??out of boundsâ?, or not in the  
container after theyâ??ve been dropped, I want them to revert, otherwise,  
drop normally.

I currently have a few JS functions setup that calculate the boundries  
of the container, and alert me on mouseupâ?¦ true if theyâ??ve been dropped  
outside of the container, and false if theyâ??ve been dropped inside the  
container.

By default, the droppable object is not set to revertâ?¦ How would I go  
about making this object revert only if itâ??s been dropped outside of the  
container?

Thanks ahead of time for any helpâ?¦

---

<div class="post-metadata">

**Author:** ![jrun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@jrun](https://www.ruby-forum.com/u/jrun)\
**Post date:** [October 15, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/revert-after-dropping-a-draggable-only-if-out-of-bounds/72230/2 "2006-10-15T21:27:04Z")

</div>

Please, this is definitely not a question for a Ruby mailing list.

j`ey  
[http://www.eachmapinject.com](http://www.eachmapinject.com)

---

<div class="post-metadata">

**Author:** ![jrun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@jrun](https://www.ruby-forum.com/u/jrun)\
**Post date:** [October 15, 2006, 9:31pm UTC](https://www.ruby-forum.com/t/revert-after-dropping-a-draggable-only-if-out-of-bounds/72230/3 "2006-10-15T21:31:05Z")

</div>

Jeremy Blah wrote:

> Hi, I have a div tag as a â??containerâ? for all my draggable objectsâ?¦ My  
> goal is to be able to decide whether to revert these objects based on  
> where they are dropped. If they are â??out of boundsâ?, or not in the  
> container after theyâ??ve been dropped, I want them to revert, otherwise,  
> drop normally.

You would do better asking this on a JavaScript or DHTML mailing list.

–  
James B.

“In physics the truth is rarely perfectly clear, and that is certainly  
universally the case in human affairs. Hence, what is not surrounded  
by  
uncertainty cannot be the truth.”

- R. Feynman
