Is it possible to open popup in popup(parent) in jquery mobile?

前端 未结 2 870
走了就别回头了
走了就别回头了 2021-01-25 23:50

I am using Jquery mobile 1.4.2. Is it possible to open popup(child popup) in popup(parent popup) ?

I tried this way,



        
相关标签:
2条回答
  • 2021-01-26 00:05

    If you look at the popup api docs : http://api.jquerymobile.com/popup/, it states the following:

    The framework does not currently support chaining of popups so it's not possible to embed a link from one popup to another popup. All links with a data-rel="popup" inside a popup will not do anything at all.

    If you need to have one popup open on top of another you will have to use a different plugin or roll your own. You can see my answer to another question Show raw jquery mobile simple dialog above another raw jquery mobile simple dialog where I used the Simpledialog2 plugin to achieve this.

    0 讨论(0)
  • 2021-01-26 00:31

    I had a similar question and was referred here. Following the popup api link above, I found a simple solution that doesn't involve a plug in.

    $(document).on("pageinit", function () {
      $('#del').click(function (e) { // e is the event
        setTimeout(function () {
            $("#popupDelete").popup("open")
        }, 100);
      });
    });
    

    I have a jsfiddle to demo this.

    0 讨论(0)
提交回复
热议问题