弹出的jQuery移动打开弹出窗口

Nic*_*ckF 6 popup jquery-mobile cordova

1.9.1 min在PhoneGap上使用jQuery mobile .
我有一个列表,其中每个单击打开一个动作弹出窗口:

function showActions(index){
    selectedIndex = index; 
    $("#actionPopup").popup("open", {positionTo: '#list li:nth-child('+ index +')'});
}
Run Code Online (Sandbox Code Playgroud)
<div data-role="popup" id="actionPopup" data-overlay-theme="a">
    <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
        <ul data-role="listview">
                <li data-role="divider">Actions</li>
                <li data-icon="false" onclick="showDetails();">action1</li>
                <li data-icon="false">action2</li>
                <li data-icon="false">action3</li>
                <li data-icon="false">action4</li>
            </ul>
        </div>
Run Code Online (Sandbox Code Playgroud)

当我按下action1时,showDetails()会调用方法,但不会显示第二个弹出窗口.

function showDetails(){
    console.log("showDetails");
    $("#infoPopup").popup("open");
}
Run Code Online (Sandbox Code Playgroud)
<div data-role="popup" id="infoPopup">
            <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
            <div id="infoContent">
                <table>
                    <tr id="eventcode">
                        <td>test1:</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr id="eventtype">
                        <td>test2:</td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

我能做什么?

Rak*_*koo 10

我的解决方案

$.mobile.switchPopup = function(sourceElement, destinationElement, onswitched) {
    var afterClose = function() {
        destinationElement.popup("open");
        sourceElement.off("popupafterclose", afterClose);

        if (onswitched && typeof onswitched === "function"){
            onswitched();
        }
    };

    sourceElement.on("popupafterclose", afterClose);
    sourceElement.popup("close");
};
Run Code Online (Sandbox Code Playgroud)