1

嗨!

有什么方法可以确定当前使用 jQuery 悬停的元素(通过鼠标)?

4

2 回答 2

0

请参阅 .mouseover() 的文档。

JQuery API 鼠标悬停

于 2010-06-15T08:50:29.307 回答
0

是的:

$("div.hover").hover( //select the elements you want to check the hover on, in this case i check all divs with the class hover
   function(){ $(this).dosomething() },
   function(){ $(this).dosomethingelse() }
)

$(this)是 acually 悬停在这里的元素是一个向您展示它是如何工作的示例:http: //jsfiddle.net/hwhe7/

第二个示例将您悬停在身体​​上的所有元素组成一个数组:http: //jsfiddle.net/mdH7L/

于 2010-06-15T08:51:07.400 回答