On Apr 28, 1:16 pm, Steph <[EMAIL PROTECTED]> wrote:
> Does anyone have any information on it? I see scattered things of
> Position.includeScrollOffsets = true;
> But that doesn't work for me.
>
> it seems to be a re-occuring theme:
> (http://dev.rubyonrails.org/ticket/5174)

Like so many other people, I've been grappling with this for a long
time with no results. After reading this post and a few others on
rubyonrails-spinoffs, I've finally come up with the following solution
which seems to fix both dragging between two scrollable divs, and the
positioning of the draggable if the parent div is scrolled. It's not
extensively tested, so comments are welcome.

---
var ScrollableDraggable = Class.create({
  initialize: function(element, ev){
    this._proxy = element.cloneNode(true);
    this._proxy.absolutize();
    this._proxy.style.opacity = 0.7;
    this._proxy.clonePosition(element);

    document.body.appendChild(this._proxy);
    new Draggable(this._proxy, {
      onEnd: function(){
        document.body.removeChild(this._proxy);
      }.bind(this)
    }).initDrag(ev);
  }
});

$$('.scrollablbleDraggable').each(function(sD)
{sD.observe('onmousedown', function(ev){new
ScrollableDraggable(Event.element(ev), ev)})});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to