0

给定以下代码:

$(classeDoFlipContainer).css('z-index', '1');
$(classeOpostaDoFlipContainer).css('z-index', '0');

flipBox.flippy({
    color_target: "white",
    duration: "900",
    verso: versoDaImagem,
    direction: "BOTTOM",
    onFinish: setEventHandlers,
    onReverseFinish: setEventHandlers
});

alert('?');
$(classeDoFlipContainer).css('z-index', '0');
$(classeOpostaDoFlipContainer).css('z-index', '1');

我添加了alert('?');只是为了验证之后的代码flippy()是否正在执行。但我只有在flippy()完全完成时才需要它。我怎样才能做到这一点?

4

3 回答 3

4

使用onFinishFlippy 提供的回调:

flipBox.flippy({
  color_target: "white",
  duration: "900",
  verso: versoDaImagem,
  direction: "BOTTOM",
  onFinish: function(){
    setEventHandlers();
    alert('?');
    $(classeDoFlipContainer).css('z-index', '0');
    $(classeOpostaDoFlipContainer).css('z-index', '1');
  },
  onReverseFinish: setEventHandlers
});

编辑:您可能还想添加onReverseFinish回调

于 2013-08-09T10:39:15.300 回答
3

使用onFinish回调:

flipBox.flippy({
    color_target: "white",
    duration: "900",
    verso: versoDaImagem,
    direction: "BOTTOM",
    onFinish: function(){
        alert('?');
    },
    onReverseFinish: setEventHandlers
});
于 2013-08-09T10:40:19.323 回答
1

你可以这样做:

onFinish:function()
{
    alert("yey!");
}
于 2013-08-09T10:41:14.710 回答