我正在尝试使用 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 函数,尝试通过代码打开它: $("#popupDialog").popup(); $("#popupDialog").popup("打开");
不确定哪里出了问题,找不到任何帮助!!!
最佳答案
在 jQM pageshow 事件而不是 jQuery 就绪事件上打开弹出窗口:
API:http://api.jquerymobile.com/1.3/pageshow/
$(document).on("pageshow","#page1", function(){
$("#popupDialog").popup("open");
});
DEMO
关于javascript - jquery 移动弹出对话框 : Cannot read property 'is' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41984799/