我正在使用jqueryui作爲對話框。第一次點擊「Click for a modal」鏈接。當按下ESC
鍵時,對話框消失。但之後的點擊不起作用。我希望這些工作。刷新頁面使一切正常。jQuery UI對話框第二次未打開
HTML:
<a href="" class="click_me" style="font-size:15px;"> Click for a modal</a><br />
<div class="demo" ">
<div id="dialog" title=" Upload Your Profile Picture" style="border1111:1px solid red; width:640px;">
this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is this is
</div><!-- end of id dialog -->
</div><!-- End demo -->
jQuery的片段:
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".click_me").bind('click', function (e) {
e.preventDefault();
$("#dialog").css('border', '5px solid #848484');
$("#dialog").dialog({
width: 460
});
//$("#dialog").dialog("option", "height", 180);
});
$("body").bind("keyup#dialog", function (event) {
// 27 == "esc"
if (event.which == 27) {
// TODO: close the dialog
// unbind the event
$("body").unbind("keyup.myDialog");
}
});
});
</script>
我怎樣才能使多次點擊的工作?
關於爲什麼給出負評分的任何解釋?看看PPvG和我之間的對話..概率仍然沒有解決 – 2012-01-03 11:04:05
我認爲你的問題被拒絕了,因爲它被回答了,但你在評論中提出了一個新問題。專業提示:在問你的下一個問題之前,先看看[問]。 – PPvG 2012-01-03 14:35:32