单击事件时打开Jquery模态对话框
问题描述:
以下代码仅对首次点击事件有效.但是,对于任何后续单击,都不会发生任何事情. 我在firefox,即ie7上进行了测试,但仍然相同.我想念什么吗?
The below code works fine for only the first click event. However for any subsequent click nothing happens. I tested this on firefox, ie7 but still the same. Am I missing something?
<script type="text/javascript">
$(document).ready(function() {
//$('#dialog').dialog();
$('#dialog_link').click(function() {
$('#dialog').dialog();
return false;
});
});
</script>
</head><body>
<div id="dialog" title="Dialog Title" style="display:none"> Some text</div>
<p id="dialog_link">Open Dialog</p>
</body></html>
答
尝试
$(document).ready(function () {
//$('#dialog').dialog();
$('#dialog_link').click(function () {
$('#dialog').dialog('open');
return false;
});
});
最后一部分有一个开放的arg
there is a open arg in the last part