[英]jquery Mobile popup dialog dismissible on options doesn't work
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);
});
更新
为了打开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)在popup
标记中定义data-dismissible
的值。
标记
<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 });
});
我遇到了同样的问题,我的解决方案是列出下面的所有选项
$("#popupDialog").popup({history: false});
$("#popupDialog").popup({corners: false});
$("#popupDialog").popup({shadow: false});
$("#popupDialog").popup("open");
这看起来并不好看,但运作良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.