簡體   English   中英

動畫不工作,循環卡住

[英]animation not working, loop get stuck

我創建動物代碼讓魚來回游泳,他只游泳一次,卡住你可以幫助請求嗎?

這里是小提琴鏈接: http//jsfiddle.net/qLCnT/3/

function anim() {
    $('#fish_1').animate({
     "left": "-90px"}, 2000, flip);
}

function back() {
    $('#fish_1').animate({
     "left": "230px"}, 2000, flipBack);
}

anim();

function flip() {
    $('#fish_1').transition({
        perspective: '100px',
        rotateY: '180deg',
        complete: back
    });
}

function flipBack() {
    $('#fish_1').transition({
        perspective: '100px',
        rotateY: '0deg',
        complete: anim
    });
}

您只是忘記將過渡庫包含在您的小提琴中,導致.transition()方法未定義:

其中的示例包括: http//jsfiddle.net/qLCnT/6/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM