开发者

Jquery unbind dialog close not work

开发者 https://www.devze.com 2023-03-18 00:13 出处:网络
I have a sequence of the dialog window and in the last dialog i\'m trying make this for remove event \"close\" the jquery dialog this mode:

I have a sequence of the dialog window and in the last dialog i'm trying make this for remove event "close" the jquery dialog this mode:

$("#cond").dialog({
开发者_如何学Python    width:'400',
    height:'100',
    modal: true,
    closeOnEscape: false,
    resizable: true,
    close: function(event, ui) { 
        f();
    }
});
function f(){
    $("#cond").unbind("dialogclose");
    loadsTab('tabsCond',0);

}

Well, this not work, because when i call first dialog the f() is called too. What's happening?


If you want to unbind the event i found out it's better to cancel it like this:

    $("#cond").dialog('option', 'close', null)

Look at this test fiddle (press open to open the dialog: the first time you close it alerts hi, the other times nothing. http://jsfiddle.net/jHXLJ/

0

精彩评论

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