开发者

Javascript function on jQuery dialog close

I have a jQuery dialog box. This box launches when a link is clicked. This link launches a function that loads the textfields within the dialog box. I have another function that is executed within the dialog load开发者_C百科 function. This looks through all of the objects and matches the table rows to the object clicked and sets a different class for that row. Now on exit i just need to do the same. How can I bind a function to the close event of that particular dialog? I just need to fire a javascript event everytime the dialog window is closed.


Is this any use?

$('div#popup_content').bind('dialogclose', function(event) {
     alert('closed');
 });

Taken from here.


You can bind an event to the beforeClose or close event of the jquery dialog box

$( ".selector" ).dialog({
   close: function(event, ui) { ... }
});

$( ".selector" ).dialog({
   beforeClose: function(event, ui) { ... }
});

http://docs.jquery.com/UI/Dialog#event-close

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜