Javascript jquery手机弹出对话框在选项上不允许';行不通
jquerymobile 1.30+jquery 1.91Javascript jquery手机弹出对话框在选项上不允许';行不通,javascript,jquery-mobile,Javascript,Jquery Mobile,jquerymobile 1.30+jquery 1.91 //dismissible doesn't apply $("#popupDialogCategoriesButton").click(function (e) { $("#popupDialogCategories").popup("open", { dismissible: false }) }); //dismissible does apply , set it af
//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);
});
更新 要打开
弹出窗口
并同时更改可解除
的值,请在弹出窗口
标记中添加不带值/空白的数据可解除=”“
,然后您可以将其更改为真
或假
加价
<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>
<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
<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
您有两个选择:
1)在弹出窗口
标记中定义数据可撤销的值。
加价
<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>
<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
<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
2)在打开之前/之后更改可驳回的值。
加价
<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>
<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
<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
我遇到了同样的问题,我的解决方案是在下面列出所有选项
$("#popupDialog").popup({history: false});
$("#popupDialog").popup({corners: false});
$("#popupDialog").popup({shadow: false});
$("#popupDialog").popup("open");
它看起来不好看,但工作很好。试试这个,你应该在弹出标记中添加
数据dismissible=“false”
。现在你可以使用.popup(“open”,“dismissible:false”)
是的,谢谢,数据dismissible=“false”可以工作,但我不想使用它,为什么open,选项不工作?我正在使用选项2,在选项事件$('popubasic').popup({dismissible:false})之后;添加data dismissible=“
空白,不带任何值,它将按照您想要的方式工作。检查此更新解决方法:)我已按我所需的方式检查了其他选项,如阴影和角点。。也不行。。我已经更新了答案,现在应该可以了。我会检查一下其余的。是的,很奇怪他们没有与dismissible
内联工作。我会进一步调查的。