jquerymobile 1.30 + jquery 1.91
//dismissible doesn't apply
$("#popupDialogCategoriesButton").click(function (e) {
$("#popupDialogCategories").popup("open", { dismissible: false })
});
//dismissible does apply , set it after open
$("#popupDialogCategoriesButton").click(function (e) {
$("#popupDialogCategories").popup('open');
$("#popupDialogCategories").popup("option", "dismissible", false);
});
答案 0 :(得分:4)
<强>更新强>
要打开popup
并同时更改dismissible
的值,请在data-dismissible=""
标记中添加popup
没有值/空白,然后您可以将其更改为true
或false
。
标记
<div data-role="popup" id="popupBasic" data-dismissible="">
<p>To close me, hit the button below.
<p> <a href="#" data-role="button" data-rel="back">close</a>
</div>
JQM
$(document).on('click', '#openpopup', function () {
$('#popupBasic').popup('open', { dismissible: false });
});
您有两种选择:
1)在data-dismissible
标记中定义popup
的值。
标记
<div data-role="popup" id="popupBasic" data-dismissible="false">
<p>To close me, hit the button below.<p>
<a href="#" data-role="button" data-rel="back">close</a>
</div>
<a href="#" data-role="button" id="openpopup">click me</a> // open it
JQM
$(document).on('click', '#openpopup', function() {
$('#popupBasic').popup("open");
});
2)在打开之前/之后更改dismissible
值。
标记
<div data-role="popup" id="popupBasic">
<p>To close me, hit the button below.<p>
<a href="#" data-role="button" data-rel="back">close</a>
</div>
<a href="#" data-role="button" id="openpopup">click me</a> // open it
JQM
$(document).on('click', '#openpopup', function() {
$('#popupBasic').popup("open");
$('#popupBasic').popup({ dismissible: false });
});
答案 1 :(得分:0)
我遇到了同样的问题,我的解决方案是列出下面的所有选项
$("#popupDialog").popup({history: false});
$("#popupDialog").popup({corners: false});
$("#popupDialog").popup({shadow: false});
$("#popupDialog").popup("open");
看起来不太好但是运作良好。