开发者

Problem with raising event on hoverin on <li>

I'm trying to select the element under the cursor so I ca开发者_如何学编程n take its text. I'm trying this as an userscript. All went good but I have small problem with lists. The code below works fine:

$("*:not(html head body").css("border", "1px solid blue");

With this it selects all elements on the page. But when I try to bind it to mouseover and similar events it doesn't work well on Amazon.com for example. I saw that happens on a li tag. Here's my code:

$("*:not(html, head, body)").live('mouseenter mouseover hover', function(e) {
   $(this).css("border", "1px solid blue");
});

Here's the Amazon.com left menu part of the source - click here

Can someone tell me idea what event to use on a hover over a li element? Or maybe a better method to do what I'm doing. Thanks.


You're missing ); at the end of that code block.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜