3

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);
            });
4

2 回答 2

4

更新

为了同时打开popup和更改 的值,dismissible在标记中添加data-dismissible=""无值/空白popup,然后您可以将其更改为truefalse

标记

<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");
});

dismissible2)在打开它之前/之后更改值。

标记

<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 });
});

实时示例 - 更新

于 2013-03-15T15:44:54.153 回答
0

我遇到了同样的问题,我的解决方案是在下面列出所有选项

$("#popupDialog").popup({history: false});
$("#popupDialog").popup({corners: false});
$("#popupDialog").popup({shadow: false});
$("#popupDialog").popup("open"); 

它不好看,但运行良好。

于 2013-07-11T06:28:46.113 回答