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)
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
2 matches
Mail list logo