2011-04-12 42 views
1

我想這樣做是爲了當一個jQuery UI對話框關閉時,文檔的focus事件被觸發。這最好不要綁定到每個對話框,而是每當任何對話框關閉時關聯到頁面本身。如何在任何jQuery UI對話框關閉時觸發事件?

我該怎麼做?

+0

你說的是一個jQuery UI的對話框? – Tim 2011-04-12 12:49:06

+0

是的,jquery-ui對話框 – Mike 2011-04-12 13:01:49

+0

那麼請看看experimentX的答案。這正是你想要的。 – Tim 2011-04-12 13:08:20

回答

5
$(".selector").dialog({ 
    close: function(event, ui) { $('#txt').focus(); } 
}); 
0

你有沒有檢查this

$(".selector").dialog({ 
    close: function(event, ui) { ... } 
}); 
0
$("#image_div").dialog({ 
     height:500, 
     width:600, 
     maxHeight: 700, 
     minWidth: 700, 
     modal: true, 
     title:'Crop Your Profile Image', 
     close: function() { 
     //your event 
     }, 
     buttons : {...} 
    }); 
相關問題