开发者

Jquery-ui, redirect to some page after you click on close button

how do i redirect after you click the close button?

$(document).ready(function() {
    var $dialog = $('<div></div>')
        .html('This dialog will show every time!')
        .dialog({
            autoOpen: false,
            title: 'Basic Dialog'
        });

    $('#opener').click(function() {
        $dialog.开发者_JAVA百科dialog('open');
        // prevent the default action, e.g., following a link
        return false;
    });
});


use

location.href="url";

you can get the bindevent like this

// give your popupid below

$('div#popupid').bind('dialogclose', function(event) {
     alert('closed');
     location.href="new url";
 });


You could define a callback for the close event in the following way as well:

$(document).ready(function() {
    var $dialog = $('<div></div>')
        .html('This dialog will show every time!')
        .dialog({
            autoOpen: false,
            title: 'Basic Dialog',
            close: function(ui, event) {
               $(this).dialog('close');
               // redirect over here.
            }
        });
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜