【发布时间】:2014-10-04 10:37:31
【问题描述】:
我有一个问题:我有一个效果悬停在一个 div 中,但我想在光标悬停在另一个 div 时触发该效果。比如:
<div id='mouse-hover-in-this-div'>
blablabla
<div id='should-trigger-mouse-hover-in-this-div'></div>
</div>
我在这里看到了一些解决方案,但它们不起作用。特别是我尝试使用 jquery .css 方法更改内部 div 的 css 属性,但我没有成功提供以下选项:
-webkit-transform: translateY(16px);
transform: translateY(16px);
-webkit-animation-name: hang;
animation-name: hang;
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
animation-direction: alternate;
我想要的悬停来自库 hover.css,我只是希望在整个 div 悬停时触发箭头的反弹效果,而不仅仅是小箭头。 我的问题有解决方案吗?
【问题讨论】:
-
你能做 JSFiddle 吗?
-
你可以使用css
#mouse-hover-in-this-div:hover #should-trigger-mouse-hover-in-this-div { ..... } -
试试这个 - jsfiddle.net/7a0e3cfw
-
这是我的小提琴:我想要达到的结果是将光标悬停在句子“this is some text”上触发效果悬停在箭头上:jsfiddle.net/a0xx6kqa
标签: javascript jquery html css hover