Position.includeScrollOffsets=true and Draggable inside a scrolling div ?

104 views
Skip to first unread message

astilla

unread,
Dec 16, 2008, 9:01:45 AM12/16/08
to Prototype & script.aculo.us
Hi,

I'm having a problem with using "Position.includeScrollOffsets = true"
with a Draggable inside a scrolling layer - the draggable is
positioned away from the mouse pointer when the layer things are in is
scrolled down. I've used the includeScrollOffsets before successfully
on a Sortable but am not having much luck with a Draggable in the same
situation - does anyone know if there is anything that needs to be
done differently?

Basic, very cut-down outline is:-

<div id="main">
<ul>
<li class="item">something</li>

... (etc) ....

</ul>
</div>

(script)
Position.includeScrollOffsets = true;

$$('li.item').each(function(item) {
new Draggable(item, {ghosting:true, scroll:'main'});
});

(css)
div#main {
position: relative;
float: left;
width: 75%;
overflow: scroll;
height: 100%;
background-color: white;
}

astilla

unread,
Dec 18, 2008, 3:15:51 AM12/18/08
to Prototype & script.aculo.us
Anyone have any ideas on this please? Still getting the problem -
everything else works perfectly, just the drag offset when the pane
the draggables are in is scrolled down any amount. Used to work fine
on a Sortable, doesn't seem to work with Draggables....

astilla

unread,
Jan 5, 2009, 9:29:40 AM1/5/09
to Prototype & script.aculo.us, nadeem...@talis.com
I didn't have any replies to this since posting it and hope someone
can help as I still have the issue.

I have created a test page that shows the issue - details on the
problem are both on the test page and in the original email (below).

http://www.astilla.co.uk/temp/draggabledemo/

Many thanks,

Andrew

On Dec 16 2008, 2:01 pm, astilla <ajb...@googlemail.com> wrote:
> Hi,
>
> I'm having a problem with using "Position.includeScrollOffsets = true"
> with aDraggableinside a scrolling layer - thedraggableis
> positioned away from the mouse pointer when the layer things are in is
> scrolled down.  I've used the includeScrollOffsets before successfully
> on a Sortable but am not having much luck with aDraggablein the same
> situation - does anyone know if there is anything that needs to be
> done differently?
>
> Basic, very cut-down outline is:-
>
> <div id="main">
> <ul>
>     <li class="item">something</li>
>
>      ... (etc) ....
>
> </ul>
> </div>
>
> (script)
>     Position.includeScrollOffsets = true;
>
>     $$('li.item').each(function(item) {
>         newDraggable(item, {ghosting:true, scroll:'main'});

astilla

unread,
Jan 5, 2009, 10:31:28 AM1/5/09
to Prototype & script.aculo.us
This trac report seems to mirror the problem I am seeing. Raised 2
years ago, updated 1 year ago - not resolved. Any idea why this
hasn't made it into the live version?

http://dev.rubyonrails.org/ticket/8356
Reply all
Reply to author
Forward
0 new messages