开发者

Add handler multiple times in jquery

How does jquery handle event assign开发者_如何学编程ment when it comes to assigning the same handler multiple times? Let's say I have

<div class="draggable">Some Text</div>

Are there any side effects (performance or otherwise) from calling the following multiple times?

$('.draggable').draggable();


If you bind a event like 'keydown' multiple times to an element, it will get attached to a queue of event handlers. So you can do the math, the more handlers are called, the slower it will perform.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜