开发者

Javascript function on jQuery dialog close

开发者 https://www.devze.com 2023-02-13 04:16 出处:网络
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

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

精彩评论

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