I've used something similar to the following:

var ListDragObserver = Class.create();
ListDragObserver.prototype = {
  initialize: function(element) {
    this.element   = $(element);
  },
  onEnd: function (eventName, draggable, event) {
        this.element.style.overflow = "auto";
  },
  onStart: function (eventName, draggable, event) {
        this.element.style.overflow = "hidden";
  },
        onDrag: function (eventName, draggable, event) {}
}


Draggables.addObserver(new ListDragObserver("someElement"));


With regard to your scrolling question, what is your issue, exactly? If it's simply the presence of scroll bars, it's likely a CSS issue, not a javascript one.



TAG

On May 29, 2006, at 5:54 AM, Jonathan Weiss wrote:


I have some elements inside a div with overflow:auto. When I trie to drag them outside of the div, the div starts to scroll. Is there a way to stop this behaviour for drag and drop? I thought of maybe using callback to disable the overflow and restoring it againg after the drop. Did someone implemented something like this?

To answer myself:


Draggables.addObserver({
  onStart: my_function_to_remove_overflow,
  onEnd: my_function_to_restore_overflow
})


Jonathan

--
Jonathan Weiss
http://blog.innerewut.de
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to