开发者

Which filters can you use in Jquery.live selectors?

开发者 https://www.devze.com 2022-12-09 10:28 出处:网络
Is there a list of which filters can be used in selectors for the live method? I had a case where I needed to bind an event to all the tr\'s in a table body excluding the first.

Is there a list of which filters can be used in selectors for the live method?

I had a case where I needed to bind an event to all the tr's in a table body excluding the first.

Broken Live Example:

$('#ExampleTable tbody tr:not(:first)').live("dblclick", RowEvent);

This would select the correct rows but the live event would bleed over onto all tables and all tr's even tho the selector would only pick the correct ones.

Working 开发者_Python百科Live Example:

$('#ExampleTable tbody tr:gt(0)').live("dblclick", RowEvent);

This selector also uses filters but it works correctly.

Both selectors used filters but only the second worked. Is this a bug or am I doing some thing wrong?


Filed as a bug on Jquery.
Bug: Live event binding not matching selector

0

精彩评论

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