anyone have any information on how to effectively use this? Event.observe() doesn''t return anything, and nothing I''ve tried is actually removing the event listeners from the objects. -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
When you create the listeners, assign them to a variable so you have a handle by which to remove them... this.myListener = this.someFunction.bindAsEventListener(this); Event.observe(this.someElement, "someEvent", this.myListener); ...now you can do this... Event.stopObserving(this.someElement, "someEvent", this.myListener); this.myListener = null; The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
On Wednesday 15 March 2006 14:42, Ryan Gahl wrote:> When you create the listeners, assign them to a variable so you have a > handle by which to remove them... > > this.myListener = this.someFunction.bindAsEventListener(this); > Event.observe(this.someElement, "someEvent", this.myListener); > > ...now you can do this... > > Event.stopObserving(this.someElement, "someEvent", this.myListener); > this.myListener = null;I tried that, and it didn''t appear to work, however I''ll give it another stab. thanks -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On Wednesday 15 March 2006 15:38, Jeremy Kitchen wrote:> On Wednesday 15 March 2006 14:42, Ryan Gahl wrote: > > When you create the listeners, assign them to a variable so you have a > > handle by which to remove them... > > > > this.myListener = this.someFunction.bindAsEventListener(this); > > Event.observe(this.someElement, "someEvent", this.myListener); > > > > ...now you can do this... > > > > Event.stopObserving(this.someElement, "someEvent", this.myListener); > > this.myListener = null; > > I tried that, and it didn''t appear to work, however I''ll give it another > stab.meh, figures, it works now ;) -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Reasonably Related Threads
- Element.observe () binding
- generic onDragStart onDrag and onDragFinish events extracted from scriptaculous?
- extending an existing DOM object in a prototype way
- dynamic generation of iframes and writing to them
- Changing the height of LI elements to achieve such an effect?