[英]onmouseover / onmouseout banner
i'm trying to make an arc scrolling banner ( as if few icons was scrolling around a sphere) with ".circulate" . 我试图用“ .circulate”做一个弧形滚动横幅(好像很少有图标在一个球体上滚动)。
I successfully did it but now i would like to do an onmouseover/onmouseout event that stop the animation when the mouse is over it 我成功做到了,但现在我想做一个onmouseover / onmouseout事件,当鼠标悬停在它上面时停止动画
html:
<div id="sphere-area" >
<img src="a.png" alt="ball" id="orange-ball" />
alt="" />
</div>
Js:
function startBallOne() {
$("#orange-ball").circulate({
speed: 4000,
height: 100,
width: -880,
sizeAdjustment: 40,
loop: true,
zIndexValues: [1, 1, 3, 3]
});
}
I tried something like 我尝试了类似的东西
$("#orange-ball").mouseout(circulate(...
but it doesnt work.. 但它不起作用..
Any ideas please? 有什么想法吗? TIA
TIA
From reading this: https://css-tricks.com/examples/Circulate/ 通过阅读以下内容: https : //css-tricks.com/examples/Circulate/
You have to call 你必须打电话
$("#anything").circulate("Stop");
ON the element. 在元素上。 So if you want to do something on mouseover/mouseout the code would look like this:
因此,如果您想对鼠标悬停/鼠标悬停做一些事情,代码将如下所示:
$("#orange-ball").mouseover(function(){
$(this).circulate({
speed: 4000,
height: 100,
width: -880,
sizeAdjustment: 40,
loop: true,
zIndexValues: [1, 1, 3, 3]
});
});
$("#orange-ball").mouseout(function(){
$(this).circulate("Stop");
})
The only issue left I see here is, that circular("Stop") only stops the loop of the animation - the animation will continue until its current iteration is done, but then won't start another one. 我在这里看到的唯一一个问题是,circular(“ Stop”)仅停止了动画的循环-动画将继续进行,直到完成当前的迭代为止,但随后将不会开始另一个动画。 That might not be what you want.
那可能不是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.