开发者

jquery obj.find(' > a.link').live()?

I am trying to setup some click events inside a jquery plugin.

The plugin is acting on the tfoot of a table. the instance of this tfoot is stored in a variable 'foot';

I am trying to use this;

foo开发者_Go百科t.find(' > div#table_pageination > #pages > a.link').live('click', function(){
    console.log('clicked');
});

However this simply has no effect.

(doing console.log(foot.find(' > div#table_pageination > #pages > a.link')); returns the links I am trying to setup.

How can I get this to work?


.live() cannot be used with chaining. You can use .delegate() instead.


You can't use live functions on non-absolute queries. That is, when start with a base set of elements, (foot in this case).

Since you have two elements with an id in there, you have some level of redundancy which could be removed. Change it to: $('#pages > a.link').live(...)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜