我有点失落-我从jquery演示页面中获取了一个弹出示例作为模板...
如果我将弹出窗口放在第一页中,它就可以工作 - 我可以从 js 脚本中调用它来打开。
因此......以下确实有效
<div data-role="page" class="page" id="Menu">
<div data-role="header" data-position="fixed" class="ui-title center">
<div data-role="controlgroup" data-type="horizontal">
<a href="#" class="ui-btn ui-corner-all ui-icon-user ui-btn-icon-notext"> </a>
<a href="#OrderList" class="ui-btn ui-corner-all width150 htitle OrderList"> <span class='htitle'>Barserver.com</span> </a>
<a href="#" class="ui-btn ui-corner-all ui-icon-gear ui-btn-icon-notext"> </a>
</div>
</div>
<div id="MainContent">
<div id="MenuList"></div>
</div>
<div data-role="popup" id="popup" data-overlay-theme="b" data-theme="b" data-dismissible="false" style="max-width:400px;">
<div data-role="header" data-theme="a">
<h1>Delete Page?</h1>
</div>
<div role="main" class="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="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Cancel</a>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">Delete</a>
</div>
</div>
我可以通过动态打开它
$("#popup").popup("open");
但是,如果我将弹出窗口移动到同一文档中的另一个(数据角色)页面,它不会显示,console.log 中也不会出现错误。谁能引导我前进?以下不起作用...
<div data-role="page" class="page" id="OrderList">
<div data-role="header" data-position="fixed" class="ui-title text-center">
<div data-role="controlgroup" data-type="horizontal">
<a href="#Menu" class="ui-btn ui-corner-all ui-icon-carat-l ui-btn-icon-notext Menu"> </a>
<a href="#Menu" class="ui-btn ui-corner-all width150 htitle Menu"> <span class='htitle'>Barserver.com</span> </a>
<a href="#Customer" class="ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext"> </a>
</div>
</div>
<div id="OrderListContent" class="productdhtml ui-content"></div>
<div data-role="popup" id="popup" data-overlay-theme="b" data-theme="b" data-dismissible="false" style="max-width:400px;">
<div data-role="header" data-theme="a">
<h1>Delete Page?</h1>
</div>
<div role="main" class="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="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Cancel</a>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">Delete</a>
</div>
</div>
</div>
为避免误解 - 第一个代码示例有效,第二个无效(意味着没有错误,没有显示类似对话框的模式)。
为什么?
(当然感谢所有帮助)