如何使用JQuery选择鼠标悬停的对象? [英] How do I select a mouse hovered object with JQuery?
本文介绍了如何使用JQuery选择鼠标悬停的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个动态生成的带有类别属性但没有ID的div标签的列表.
I have a list of dynamically generated div-tags with a class-attribute but no id.
如何选择一个用鼠标光标悬停的鼠标? 在CSS中是这样的:div.classname:hover
How do I select the one which is hovered with mouse cursor? In CSS it would be like this: div.classname:hover
哦,我不想使用任何额外的Jquery插件.
Oh, and I wouldn't like to use any extra Jquery-plugins.
推荐答案
$('div.classname').hover(
function mouseover() { /* do something */},
function mouseout() { /* do other thing */}
);
谢谢,米卡!
这篇关于如何使用JQuery选择鼠标悬停的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文