당신은 아마 이미지 데이터로 전이 상태를 절약 할 수있다. 변환이 완료되면 데이터를 플래그로 설정하십시오. 플립을 시작하기 전에이 플래그를 확인할 수 있습니다. 필요한 경우 이벤트 처리기에서 false를 반환하거나 event.stopImmediatePropagation()
을 호출하여 이벤트를 중지 할 수 있습니다.
$('#myImageFlow img').on('click', function (event){
var $img = $(this);
if !($img.data('isTransitionFinished') {
event.stopImmediatePropagation();
} else {
$img.flip(); // Assuming you made flip a jQuery plugin
}
};
$.fn.flip = function() {
this.data('isTransitionFinished', false); // Reset from any previous transitions
var properties = {}; // Whatever property changes you're applying for the transition
this.animate(properties, {
complete: function() {
this.data('isTransitionFinished', true);
}
});
}
['.live()'] (http://api.jquery.com/live/)은 더 이상 사용되지 않습니다. ['.on()'] (http://api.jquery.com/on/) 또는 ['.delegate()'] (http://api.jquery.com/delegate/)를 사용하십시오. – SeinopSys
HTML은 어떤 모습입니까? – j08691
여기에 코드를 게시 할 수 있습니까? –