繁体   English   中英

循环Jquery + mouseover / mouseout事件

[英]circulate Jquery + mouseover/mouseout event

我正在尝试使用.circulate
我希望动画在onmouseover / onmouseout时停止(暂停)/继续

这是来自https://css-tricks.com/examples/Circulate/的代码

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]
});
}

我试过了

$("#orange-ball").mouseout(circulate(...

要么

$("#orange-ball").mouseover(function(){
$(this).circulate

但是没有用..

有任何想法吗 ?

TIA

只需尝试将您的JS代码放入$(doument).ready()函数中即可。

$(document).ready(function(){
    function startBallOne() {
        $("#orange-ball").circulate({
            speed: 4000,
            height: 100,
            width: -880,
            sizeAdjustment: 40,
            loop: true,
            zIndexValues: [1, 1, 3, 3]
        });
    }
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM