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?
精彩评论