更新
为了同时打开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");
});
dismissible
2)在打开它之前/之后更改值。
标记
<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 });
});
实时示例 - 更新