如何在shadowbox完成打开时调用函数

时间:2012-05-24 11:03:01

标签: jquery html shadowbox

我需要在打开shadowbox并在我的页面中显示时调用一个函数。 我试试这个:

Shadowbox.open({
    content:    contentD,
    player:     "html",
    title:      "Pubblicazione annunci in corso...",
    height:     350,
    width:      350,
    options: { 
            modal:   true,
            onOpen: myOpen
    }
});

function myOpen(){
   alert('ok');
}

我的问题是在显示shadowbox之前显示alert('ok'),我该怎么办?有人能帮我吗?

1 个答案:

答案 0 :(得分:1)

通过onClose更改onOpen;)

Shadowbox.open({
    content:    contentD,
    player:     "html",
    title:      "Pubblicazione annunci in corso...",
    height:     350,
    width:      350,
    options: { 
            modal:   true,
            onClose: myOpen
    }
});