i creat animation code for the fish to swim back and forth and he only swim 1 time and stuck can you help pleas?
here is the fiddle link: 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
});
}
You've just forgotten to include the transit library in your fiddle, causing the .transition() method to be undefined:
Example with it included: http://jsfiddle.net/qLCnT/6/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With