我正在尝试使用jquery打开对话框。我使用链接http://demos.jquerymobile.com/1.2.0/docs/pages/popup/index.html
跟踪了说明代码如下: 对话框
<div data-role="popup" id="popupDialog" data-overlay-theme="a" data-theme="c" style="max-width:400px;" class="ui-corner-all">
<div data-role="header" data-theme="a" class="ui-corner-top">
<h1>Delete Page?</h1>
</div>
<div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
<h3 class="ui-title">Are you sure you want to delete this page?</h3>
<p>This action cannot be undone.</p>
<a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Cancel</a>
<a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Delete</a>
</div>
</div>
关于jquery ready函数,尝试通过代码打开它: $(&#34;#PopUpDialog,这个PopUpDialog&#34)。弹出(); $(&#34;#PopUpDialog,这个PopUpDialog&#34)弹出。(&#34;开&#34);
不确定有什么问题,无法找到任何帮助!
答案 0 :(得分:2)
打开jQM pageshow事件的弹出窗口而不是jQuery ready事件:
API:http://api.jquerymobile.com/1.3/pageshow/
$(document).on("pageshow","#page1", function(){
$("#popupDialog").popup("open");
});