gpt4 book ai didi

javascript - jquery 移动弹出对话框 : Cannot read property 'is' of undefined

转载 作者:太空宇宙 更新时间:2023-11-04 01:59:42 24 4
gpt4 key购买 nike

我正在尝试使用 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("打开");

getting error

不确定哪里出了问题,找不到任何帮助!!!

最佳答案

在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com