查找悬停 CSS 属性
假设我有一个具有多个类的元素,其中一个类有一个悬停伪类。可以说这会改变颜色。
所以我想做的是找出当鼠标悬停在元素上时会变成什么颜色。然后我想用 Javascript/jQuery 覆盖它。
Lets say I had an element with multiple classes, one of these classes has a hover pseudo-class. Lets say this will change the colour.
So what I want to do is find out what colour the element will change to when hovered over. Then I want to override this with Javascript/jQuery.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
animateToSelector jQuery 插件 似乎可以满足您的需求。
我通过 另一个找到了该插件StackOverflow 上的问题。另请查看这个问题,看看实际上并没有除通过
document.styleSheets
之外的任何其他方法都可以做到这一点。The animateToSelector jQuery plug-in seems to do what you want.
I found that plug-in through another question on StackOverflow. Also have a look at this question to see there isn't really any other way to do it but by going through
document.styleSheets
.