2014-03-26 40 views
-2

在這個小提琴顯示一個對話框:關閉對話框時添加監聽器?

http://jsfiddle.net/6M5g4/

小提琴代碼:

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>jQuery UI Dialog - Default functionality</title> 
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> 
    <script src="//code.jquery.com/jquery-1.9.1.js"></script> 
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 
    <link rel="stylesheet" href="/resources/demos/style.css"> 
    <script> 
    $(function() { 
    $("#dialog").dialog(); 
    }); 
    </script> 
</head> 
<body> 

<div id="dialog" title="Basic dialog"> 
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> 
</div> 


</body> 
</html> 

有一個聽衆,我可以添加,如果點擊「X」按鈕,觸發或者如果對話框是通過對話框上的按鈕關閉的?

+2

http://api.jqueryui.com/dialog/#events是。 –

+0

你應該真正熟悉你正在使用的元素的文檔。這個世界不需要另一個複製/粘貼開發者。 – Smeegs

回答