how to animate two continuous popup windows with jquery mobile?

只愿长相守 提交于 2020-01-03 03:08:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!