jQuery trigger performance

535 Views Asked by At

I have a performance issue with jquery trigger. My code contains this line

$(ispan).trigger('click','itoc'); //ispan is a img element

Here the total time taken to execute this line of code is almost 3 seconds. ispan is only one element. I have done some research that the trigger is doing event bubbling up the DOM tree which might consume this much time. How can I prevent the event bubbling. or is there any way that I can improve the performance of this trigger. any help wld be highly appreciated.

0

There are 0 best solutions below