Jquery 不改变页面的移动对话框
Jquery mobile dialogbox without changing page
我必须在 phonegap 中显示动态弹出窗口 appliction.I 使用 Jquery 移动和 javascript 使弹出窗口动态化,但弹出窗口在整个应用程序中都是白色背景。
请帮助我以正确的形式得到这个。
Html代码:
<div id="popupMsgPage" data-role="popup" data-close-btn="right" data-theme="c" data-overlay-theme="c">
<div data-role="header" data-position="fixed" >
<h1 id="popup-head">Delete Page?</h1>
</div>
<div role="main" class="ui-content">
<h3 class="ui-title" id="popup-title">Are you sure you want to delete this page?</h3>
<p id="popup-content">This action cannot be undone.</p>
<a href="#" data-rel="back" data-rel-count="1" data-role="button" >Continue</a>
</div>
Jquery代码:
function show(head, title, msg) {
debugger;
head = head ? head : "";
title = title ? title : "";
msg = msg ? msg : "";
jPages["popupMsg"].find("#popup-head").html(head);
jPages["popupMsg"].find("#popup-title").html(title);
jPages["popupMsg"].find("#popup-content").html(msg);
$.mobile.changePage("#popupMsgPage", {
role: "dialog"
});
我认为您混淆了弹出窗口小部件和对话框页面。如果您不想更改页面,请像这样使用弹出窗口小部件:
function show(head, title, msg) {
head = head ? head : "";
title = title ? title : "";
msg = msg ? msg : "";
$("#popupMsgPage").find("#popup-head").html(head);
$("#popupMsgPage").find("#popup-title").html(title);
$("#popupMsgPage").find("#popup-content").html(msg);
$("#popupMsgPage").popup("open");
}
Working DEMO
我必须在 phonegap 中显示动态弹出窗口 appliction.I 使用 Jquery 移动和 javascript 使弹出窗口动态化,但弹出窗口在整个应用程序中都是白色背景。 请帮助我以正确的形式得到这个。 Html代码:
<div id="popupMsgPage" data-role="popup" data-close-btn="right" data-theme="c" data-overlay-theme="c">
<div data-role="header" data-position="fixed" >
<h1 id="popup-head">Delete Page?</h1>
</div>
<div role="main" class="ui-content">
<h3 class="ui-title" id="popup-title">Are you sure you want to delete this page?</h3>
<p id="popup-content">This action cannot be undone.</p>
<a href="#" data-rel="back" data-rel-count="1" data-role="button" >Continue</a>
</div>
Jquery代码:
function show(head, title, msg) {
debugger;
head = head ? head : "";
title = title ? title : "";
msg = msg ? msg : "";
jPages["popupMsg"].find("#popup-head").html(head);
jPages["popupMsg"].find("#popup-title").html(title);
jPages["popupMsg"].find("#popup-content").html(msg);
$.mobile.changePage("#popupMsgPage", {
role: "dialog"
});
我认为您混淆了弹出窗口小部件和对话框页面。如果您不想更改页面,请像这样使用弹出窗口小部件:
function show(head, title, msg) {
head = head ? head : "";
title = title ? title : "";
msg = msg ? msg : "";
$("#popupMsgPage").find("#popup-head").html(head);
$("#popupMsgPage").find("#popup-title").html(title);
$("#popupMsgPage").find("#popup-content").html(msg);
$("#popupMsgPage").popup("open");
}
Working DEMO