# Scroll Page While Dragging 'draggable\_element'

**URL:** <https://www.ruby-forum.com/t/scroll-page-while-dragging-draggable-element/110424>\
**Category:** Rails\
**Created:** [July 26, 2007, 7:33am UTC](https://www.ruby-forum.com/t/scroll-page-while-dragging-draggable-element/110424 "2007-07-26T07:33:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@brandon](https://www.ruby-forum.com/u/brandon)\
**Post date:** [July 26, 2007, 7:33am UTC](https://www.ruby-forum.com/t/scroll-page-while-dragging-draggable-element/110424/1 "2007-07-26T07:33:56Z")

</div>

Hi - I posted this on another list, but received no response, so I’m  
trying this one. My apologies to those who have seen this question  
twice.

I have two columns, one of draggable elements, the other of  
droppable elements. These are used to add items to a particular  
collection. (Story :habtm ‘Assets’)

Column 1 (Assets) Column 2 (Stories)  
============== ==============  
Draggable 1 Droppable 1  
Draggable 2 Droppable 2  
… …  
etc.

I need to be able to drag any item from the first column onto any item  
in the second column, even when the lists are long and both elements  
are not visible on the screen at once, so I need the page to scroll  
when I drag an asset to the edge of the browser screen.

I currently use the draggable\_element helper on each of the assets,  
and drop\_receiving\_element on each of the stories. What can I do so  
that when I want to drag an asset to a story that is off-screen, the  
page will scroll until that story comes into view?

Many thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![brandon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@brandon](https://www.ruby-forum.com/u/brandon)\
**Post date:** [July 27, 2007, 10:34am UTC](https://www.ruby-forum.com/t/scroll-page-while-dragging-draggable-element/110424/2 "2007-07-27T10:34:29Z")

</div>

Hi,

> Hi - I posted this on another list, but received no response,

AFAIK, it is because of the general problem, you have with drag&drag and  
scrollable parts (“overflow: scroll” / “overflow: auto”)

[Drag draggables outside  
an  
overflow:auto div to an external droppable container](http://dev.rubyonrails.org/ticket/5771)

so either you use intensively Javascript or find some workarounds:

[overflow:  
scroll hack and draggable element substitution](http://wiki.script.aculo.us/scriptaculous/show/EffectsTreasureChest)

(link doesn’t work at the moment, sorry, but hopefully the Patch should  
give you  
some hints)

😉
