问题
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");
The first popup window did disappeared. However the second popup window didn't popup. How can I do this with mobile jquery? Thank you!
回答1:
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
来源:https://stackoverflow.com/questions/20809184/how-to-animate-two-continuous-popup-windows-with-jquery-mobile