JQuery Modal对话框关闭事件

时间:2011-04-09 00:32:58

标签: jquery ruby-on-rails

我有一个ruby-on-rails应用程序,它为首次使用的用户显示模式对话框。但是,如果用户关闭对话框,我想将用户重定向到主页。我怎么做?这是我的JQuery片段。感谢。

this.dialog(
    {
        modal:true, 
        width:'auto',
        height:'auto',
        title: 'New to Purchest? Subscribe to deals that interest you!'

        close: function(event, ui) {  }
    }
)

1 个答案:

答案 0 :(得分:4)

我认为这就像向close回调添加代码一样简单:

this.dialog(
{
    modal:true, 
    width:'auto',
    height:'auto',
    title: 'New to Purchest? Subscribe to deals that interest you!'

    close: function(event, ui) {
        top.location.href = 'http://www.wheredoyouwanttogotoday.com';
        // ^^ obscure microsoft marketing reference
    }
});