[jQuery] Re: Custom Events and Propagation

2009-01-25 Thread Ricardo Tomasi
Use event delegation, will give you better performance: $(document).mouseup(function(e){ if (conditionsMet) $(e.target).trigger('customevent', [customdata]); }); If you want to stick with binding all elements, try: $(*).mouseup(function(e) { if (conditionsMet)

[jQuery] Re: Custom Events and Propagation

2009-01-25 Thread Michael Bleigh
Thanks! That is exactly what I needed. I didn't think about the fact that the event target would give me the specific element even if the listener was higher up the propagation chain. On Jan 25, 6:48 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Use event delegation, will give you better