开发者

problem with Jquery LIVE with $(this)

I have a problem, I'开发者_JAVA百科m using .live() to bind mouseenter like this:

$('a').live('mouseenter',function(e){
  alert($(this).attr('title'));
});

For all my links I get an alert for the first link's title, I think the problem is from $(this) but I'm not sure, can anyone help?


I don't think the code you posted is what's actually running, it works :) You can test it here: http://jsfiddle.net/YyMDg/

See what the difference is in your actual code, are you looping somewhere for example, and $(this) isn't being evaluated in the handler but somewhere outside of it?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜