2013-03-23 3 views
1

여러 이미지를 하나씩 뒤집을 수있는 함수를 만들려고합니다. 내가 뭘 잘못하고 있다고 생각하니? 미리 감사드립니다.jquery flip multiple images

function flipImage(totCount, flipCount) { 

    totCount--; 
    var cnt = flipCount; 
    cnt++; 
    var id = '#flip'+cnt; 

    $(id).flip({ 
     speed:400, 
     color: 'red', 
     direction: 'rl', 
     onAnimation: if (cnt > 0){flipImage(totCount, cnt)}, 
     onEnd: function() { 

      $(id).show(400); 
     } 
    }); 
} 
+1

코드에서 작동하지 않는 것은 무엇입니까? –

+0

그것은 onAnimation에서 구문 오류를 말합니다 : if (cnt> 0) {flipImage (totCount, cnt)}, – daved

+1

예 thats correct ... 그러면 오류가 발생합니다 .. –

답변

1

대신 conditions을 사용할 수 없습니다.

onAnimation: function(){ 
    if (cnt > 0){flipImage(totCount, cnt)} 
}, 
+0

고마워요! – daved

+0

@daved 환영 .. –