悬停项目与JQuery [英] Hover Item with JQuery
问题描述
我不想创建另一个类,我只是希望当鼠标指针不在该元素上时使元素悬停在javascript中。
例如,我有5个元素具有相同的类,并且当其中一个实际上被徘徊时,我希望将其悬停在所有这些元素上。
我假设你是指你已经与链接关联的伪类:hover
(例如)。当您将鼠标悬停在该链接上时,您想要调用所有其他链接的:hover
样式。
不幸的是,您可以不要从jQuery调用:hover
样式,这要求您实际将鼠标指针移动到该元素上。您必须使用类并使用jQuery的悬停事件。
Is there a way to hover an element using javascript? I don't want to create another class, I just want to cause element to hover with javascript when my mouse pointer is not over that element.
For example I have 5 elements with the same class and I want to call hover on all of them when one of them is actually hovered.
I assume you mean the pseudo class :hover
that you've associated with a link (for example). As you hover over that link, you want to invoke all other link's :hover
styles.
Unfortunately, you can not invoke the :hover
styles from jQuery, that requires that you actually move your mouse pointer over that element. You have to use classes and utilize jQuery's hover event.
这篇关于悬停项目与JQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!