[英]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.