【发布时间】:2012-03-22 03:13:50
【问题描述】:
我正在使用 simpledialog2 在我的 jQuery Mobile 应用程序中创建对话框。
至少在 Google Chrome 中,如果用户通过单击其中一个列表视图项打开对话框,然后将其关闭,然后立即打开另一个,则当用户单击列表项时,对话框将不再打开。
这是jsFiddle
为什么?
这是我的 HTML。
<ul data-role="listview">
<li><a href="#">foo</a></li>
<li><a href="#">bar</a></li>
<li><a href="#">baz</a></li>
</ul>
和 Javascript。
$(function() {
// When user clicks on a list item, produce a dialogue/alert box.
$('[data-role="listview"] a').click(function(event) {
event.preventDefault();
$('<div>').simpledialog2({
mode: 'blank',
headerText: "Popup title",
headerClose: true,
dialogForce: true,
blankContent:
"My message to you."
});
});
});
【问题讨论】:
标签: javascript jquery jquery-plugins jquery-mobile