1
我使用orangeBox lightbox并有一个视频自动加载,在页面加载 - 工作正常。关闭方法jQuery的橙箱不工作
我想要发生的事情是,当视频(在orangeBox中)被关闭时 - 页面上会发生其他事情,但我无法使用开闭方法工作。
由于某种原因,该方法在页面加载时触发,当我尝试将它绑定到ob窗口时 - 什么都不会触发。
有人可以看看我有什么 - 也许我已经把它设置错了吗?
这里是我的代码:
$(function(){
function autoOpen(){
$('#autoOpen').orangeBox('create');
}
function checkOB(){
if ($("#ob_window").length) {alert("OB closing");}
}
function checkOB2(){
alert("OB closing");
}
function starting(){
alert("OB starting");
}
$(document).bind('oB_closing', checkOB());
$(document).bind('oB_closed', checkOB2());
$(document).bind('oB_init', starting());
setTimeout(autoOpen,500);
});
谢谢!
令人惊叹 - 感谢您的解决方案,并花时间解释其背后的原因。 – kneidels
干杯,很高兴我能帮上忙。 –