I''d like to drag images onto drop zones. I have a working demo with one problem: the image leaves the dock and then "snaps back" to it: (broken -- image leaves dock during drag then snaps back) http://u32.net/junq/imlib-demo-1/ I can get the image to remain in the dock during the drag using ''ghosting:true''. But how do I keep the original in the dock after the move? (broken: image moves off the dock after the drag) http://u32.net/junq/imlib-demo-1/ I tried playing around with reverts but didn''t get anywhere: <script type="text/javascript">new Draggable(''image1'', {ghosting:true, reverteffect: function(e,t,l) { e.setStyle({left: l, top: t}) }})</script> Any ideas? Thank you, - Scott
On Tue, 2006-05-23 at 16:56 -0400, Scott Bronson wrote:> (broken: image moves off the dock after the drag) > http://u32.net/junq/imlib-demo-1/Ack! Sorry, that link should, of course, have been http://u32.net/junq/imlib-demo-2/
Scott Bronson wrote:> Any ideas? Thank you,Disable ghosting (so it doesn''t try to do this for you) and clone the node yourself (much like ghosting does). Then if the drag fails delete the clone (allowing the revert to move the element back). If the drag succeeds then you can leave the cloned node. You may need to make the clone into a draggable so it is ready to be dragged again. Eric
Martinez, Andrew
2006-May-23 21:49 UTC
RE: Re: Dragging a copy of an image and then reverting
Enable ghosting, create a revert function that instantly sets the img node back into place. I''ll see if I can whip up some code tomorrow if you don''t state you overcame your problem. It is time for me to call it quits for today. -Andrew Martinez -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Eric Anderson Sent: Tuesday, May 23, 2006 5:16 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Re: Dragging a copy of an image and then reverting Scott Bronson wrote:> Any ideas? Thank you,Disable ghosting (so it doesn''t try to do this for you) and clone the node yourself (much like ghosting does). Then if the drag fails delete the clone (allowing the revert to move the element back). If the drag succeeds then you can leave the cloned node. You may need to make the clone into a draggable so it is ready to be dragged again. Eric _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs