jQuery Mobile中的弹出窗口没有按预期工作,请提供建议。
弹出式DIV仍然可见,人们会期望隐藏DIV并且在点击链接时它不会弹出。它似乎可以在jQuery文档的演示中使用。
以下代码有问题吗?
<a href="#transitionExample" data-transition="pop" data-role="button" data-inline="true" data-rel="popup">Pop Up</a>
<div data-role="popup" id="transitionExample">
This is a POP UP.
</div>
答案 0 :(得分:5)
您正在使用尚未发布的测试版功能,我会检查以确保您使用
实例:
文档:
您的密码:
<div data-role="page" class="type-interior">
<div data-role="content" class="ui-body">
<a href="#transitionExample" data-transition="pop" data-role="button" data-inline="true" data-rel="popup">Pop Up</a>
<div data-role="popup" id="transitionExample">
This is a POP UP.
</div>
</div>
</div>
答案 1 :(得分:1)
HTML
<p>You have entered: <span id="dialogoutput"></span></p>
<a href="#" id="dialoglink" data-role="button">Open Dialog</a>
的jQuery
$(document).delegate('#simplestring', 'click', function() {
$(this).simpledialog({
'mode' : 'string',
'prompt' : 'What do you say?',
'buttons' : {
'OK': {
click: function () {
$('#dialogoutput').text($('#dialoglink').attr('data-string'));
}
},
'Cancel': {
click: function () { },
icon: "delete",
theme: "c"
}
}
})
})
Referance:_
http://jquerymobile.com/branches/popup-widget/docs/pages/popup/index.html