Cheers, Tom Gregory wrote:
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"));
Thanks, I now have something like this in use.
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.
Yes, it is now more a CSS problem. I need to disable the scroll/auto so that I can drag outside the container but hidden does not work as the dragged element is hidden when dragging out of the container (which makes sense).
When I disable overflow the content of the div flows over another and the dragged element 'ghost image' is jumping to the bottom of the page. I assume that this happens because with the overflow restriction gone, the content expands (moving my draggable div to the bottom) and the JS code still thinks that it's position is unchanged.
It's difficult to explain but the solution would be to disable scrolling while dragging but still preserve the overflow CSS. So that the overflow style is still in place but not triggered by the drag.
TAG
Regards, Jonathan _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
