给出以下代码:
$(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()
时才需要它。我怎样才能做到这一点?
答案 0 :(得分:4)
使用flippy提供的onFinish
回调:
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
回调
答案 1 :(得分:3)
使用onFinish
回调:
flipBox.flippy({
color_target: "white",
duration: "900",
verso: versoDaImagem,
direction: "BOTTOM",
onFinish: function(){
alert('?');
},
onReverseFinish: setEventHandlers
});
答案 2 :(得分:1)
onFinish:function()
{
alert("yey!");
}