【问题标题】:circulate Jquery + mouseover/mouseout event循环 Jquery + mouseover/mouseout 事件
【发布时间】:2016-08-10 11:31:15
【问题描述】:

我正在尝试使用 .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

【问题讨论】:

    标签: javascript animation events onmouseover onmouseout


    【解决方案1】:

    试着把你的 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]
            });
        }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-03
      • 1970-01-01
      • 2011-07-29
      • 1970-01-01
      • 1970-01-01
      • 2013-01-13
      • 2011-04-13
      相关资源
      最近更新 更多