Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1027 bytes Desc: image001.gif Url : wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/b3c26edf/attachment.gif
how about onChange: Jamie On Oct 14, 2005, at 1:40 PM, Whitcraft, Jon wrote:> Is there a way to run commands when you start a drag with a draggable? > > > > Thanks > > > > <image001.gif> > > Jon Whitcraft > Indianapolis Motor Speedway > jwhitcraft@brickyard.com > > Phone: (317) 492-8623 :: Fax: (317) 492-6419 > > > > ******************** > ******************** > This E-mail (and attachments) may contain confidential/privileged > information intended only for the named addressee(s). If you are > not an intended recipient, do not read, copy, disseminate or take > any action based on the content of this E-mail. Please notify the > sender by reply E-mail and erase this E-mail from your system. Your > assistance is appreciated. E-mail transmission may not be secure or > error-free. The company is not responsible for any loss/damage > arising from any virus transmitted. > ******************** > ******************** > <image001.gif> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/1202e0f2/attachment.html
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1027 bytes Desc: image001.gif Url : wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/95e3683c/attachment-0001.gif
Maybe I don''t understand what you are trying to do, but I set the background color of a draggable when I start dragging it by calling onChange: Sortable.create("some_id",{ghosting:true,constraint:false, new Effect.Pulsate(sortable);}, onChange:function(sortable){$ (sortable.style.backgroundColor = "#ffff00");} }); On Oct 14, 2005, at 3:29 PM, Whitcraft, Jon wrote:> That is not a valid function. > > > > <image001.gif> > > Jon Whitcraft > Indianapolis Motor Speedway > jwhitcraft@brickyard.com > > Phone: (317) 492-8623 :: Fax: (317) 492-6419 > > > > From: rails-spinoffs-bounces@lists.rubyonrails.org [mailto:rails- > spinoffs-bounces@lists.rubyonrails.org] On Behalf Of Jamie Orchard- > Hays > Sent: Friday, October 14, 2005 1:46 PM > To: rails-spinoffs@lists.rubyonrails.org > Subject: Re: [Rails-spinoffs] Draggables onDragStart > > > > how about onChange: > > > > Jamie > > > > > > On Oct 14, 2005, at 1:40 PM, Whitcraft, Jon wrote: > > > > > Is there a way to run commands when you start a drag with a draggable? > > > > Thanks > > > > > <image001.gif> > > > > Jon Whitcraft > Indianapolis Motor Speedway > jwhitcraft@brickyard.com > > Phone: (317) 492-8623 :: Fax: (317) 492-6419 > > > > ******************** > > ******************** > > This E-mail (and attachments) may contain confidential/privileged > information intended only for the named addressee(s). If you are > not an intended recipient, do not read, copy, disseminate or take > any action based on the content of this E-mail. Please notify the > sender by reply E-mail and erase this E-mail from your system. Your > assistance is appreciated. E-mail transmission may not be secure or > error-free. The company is not responsible for any loss/damage > arising from any virus transmitted. > > ******************** > > ******************** > > <image001.gif> > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > <image001.gif> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/d53f8346/attachment.html
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1027 bytes Desc: image001.gif Url : wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/4f6c5a07/attachment-0001.gif
Currently, there are two ways to do this: 1) Use a draggable observer: var myobserver = { onStart: function(draggable) { // do something, e.g. alert(draggable.element) }, onEnd: function(draggable) { // do something } } Draggables.addObserver(myobserver); new Draggable(''element_id''); 2) Use the starteffect callback: new Draggable(''element_id'',{starteffect:function() { do somehting }}); Both are probably not the optimal way for your requirement, so I concur that some more callbacks should make it in. :) Thomas Am 14.10.2005 um 19:40 schrieb Whitcraft, Jon:> Is there a way to run commands when you start a drag with a draggable?-------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051015/8953ca3a/attachment.html
Thanks, That works great. Jon ________________________________ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org on behalf of Thomas Fuchs Sent: Sat 10/15/2005 1:51 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Draggables onDragStart Currently, there are two ways to do this: 1) Use a draggable observer: var myobserver = { onStart: function(draggable) { // do something, e.g. alert(draggable.element) }, onEnd: function(draggable) { // do something } } Draggables.addObserver(myobserver); new Draggable(''element_id''); 2) Use the starteffect callback: new Draggable(''element_id'',{starteffect:function() { do somehting }}); Both are probably not the optimal way for your requirement, so I concur that some more callbacks should make it in. :) Thomas Am 14.10.2005 um 19:40 schrieb Whitcraft, Jon: Is there a way to run commands when you start a drag with a draggable? ******************** ******************** This E-mail (and attachments) may contain confidential/privileged information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy, disseminate or take any action based on the content of this E-mail. Please notify the sender by reply E-mail and erase this E-mail from your system. Your assistance is appreciated. E-mail transmission may not be secure or error-free. The company is not responsible for any loss/damage arising from any virus transmitted. ******************** ******************** _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Apparently Analagous Threads
- Draggable - how start action on start dragging and end action on droppping
- generic onDragStart onDrag and onDragFinish events extracted from scriptaculous?
- Finding Final Position with a Draggable Object
- Really easy field validation with Prototype Help
- a place to put prototype and scriptaculous documentation.