如何使用jquery mobile为两个连续的弹出窗口设置动画? [英] how to animate two continuous popup windows with jquery mobile?
问题描述
我想用jquery mobile做的是当我点击第一个弹出窗口上的按钮时,第一个弹出窗口将以翻转动画消失,之后第二个弹出窗口将出现相同类型的动画。我试图在事件监听器中使用它:
What I want to do with jquery mobile is when I click a button on the first popup window, the first popup window will disappear with a flip animation, after which the second popup window will appear with the same kind of animation. I tried to use this in the event listener:
$("#div_first").popup("close");
$("#div_second").popup("open");
第一个弹出窗口确实消失了。但是第二个弹出窗口没有弹出。我怎么能用移动jquery做到这一点?谢谢!
The first popup window did disappeared. However the second popup window didn't popup. How can I do this with mobile jquery? Thank you!
推荐答案
当前需要拨打下一个弹出窗口
弹出窗口已关闭 popupafterclose
。此外,重要的是 data-history =false
以弹出div,以便不会将历史记录返回到之前的活动。
You need to call next popup
once the current popup is closed popupafterclose
. Moreover, it is important to data-history="false"
to popup div in order not to go back in history to previous activity.
$("#pop1").popup("open", { /* open first popup */
positionTo: "window",
transition: "flip"
}).on("popupafterclose", function () { /* open second popup */
$("#pop2").popup("open", {
positionTo: "window",
transition: "flip",
reverse: true /* optional for reverse effect */
});
});
Demo
这篇关于如何使用jquery mobile为两个连续的弹出窗口设置动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!