在popup jquery mobile中打开弹出窗口

时间:2016-01-01 12:04:23

标签: javascript jquery popup

新年快乐的家伙们。我试图在列表项目上长按后显示弹出窗口,此功能运行良好。但点击#pp<?php echo $rowres2['id']; ?>后,当前弹出窗口应关闭,#m<?php echo $rowres2['id']; ?>应显示出来。关闭工作但关闭后第二个弹出窗口的打开不会工作。会发生什么事?

列表项中的2个弹出窗口:

        <li data-icon="false" class="listitem<?php echo $rowres2['id']; ?>"><a id="<?php echo $rowres2['id']; ?>" onclick="viewz()"></a>
//first popup
            <div style="width:100%; height:100%; padding-left:25%; padding-top:25%" id="m<?php echo $rowres2['id']; ?>" data-role="popup" class="delete" >       
                 <div data-role="main" class="ui-content">
                 <h1>Do you really quit this chat?</h1>
                 <form data-ajax="false" name="login-form" class="login-form" action="./deletechats.php" method="post">
                 <input type="hidden" name="idelete" id="idelete" value="<?php echo $rowres2['id']; ?>" type="text" />     


                <button type="submit" name="submituzbuh655n6" class="ui-btn" >yes</button>
                </form>
                <a class="ui-btn" id="gffgb" data-rel="back" >back</a>
                </div>      

            </div>
        //second popup
            <div data-role="popup" id="p<?php echo $rowres2['id']; ?>">
                <ul data-role="listview" data-inset="true">
                    <li><a id="pp<?php echo $rowres2['id']; ?>">quit chat</a></li>
                </ul>
        </div>
    </li>

jquery代码:

<script>
$(".listitem<?php echo $rowres2['id']; ?>").on("taphold",function(){
    $("#p<?php echo $rowres2['id']; ?>").popup( "open" );
});
$("#pp<?php echo $rowres2['id']; ?>").click(function() {
    $("#p<?php echo $rowres2['id']; ?>").popup( "close" );
$("#m<?php echo $rowres2['id']; ?>").popup( "open" );   
}); 
 </script>

0 个答案:

没有答案