gpt4 book ai didi

javascript - bpopup onClose 回调事件不起作用

转载 作者:行者123 更新时间:2023-11-30 17:19:59 27 4
gpt4 key购买 nike

回调事件不会在通过模态、关闭按钮和 esc 关闭弹出窗口时触发
我已经尝试将其添加到准备就绪的文档中,并且在单击触发器时它们都起作用了

 $('.flipvideowrap').bind('click', function(e) {
e.preventDefault();
$('#element_to_pop_up').bPopup({
appendTo: 'form'
, zIndex: 1001
, easing: 'easeOutBack'
, speed: 450
, transition: 'fadeIn'
, appendTo:'body'
, closeClass: 'b-close'
, modalClose: true
, modalColor: '#fff'
, model: false
,escClose:true
, position: ['auto', 42] //x, y
});
$("video").trigger("play");

$('#element_to_pop_up').bPopup({ onClose: function(){
console.log('closed');
var myPlayer = videojs('look_video');
myPlayer.pause();
}});

});

最佳答案

看起来您的代码实际上触发了两次弹出。试试这个:

$('.flipvideowrap').bind('click', function(e) {
e.preventDefault();
$('#element_to_pop_up').bPopup({
appendTo: 'form'
, zIndex: 1001
, easing: 'easeOutBack'
, speed: 450
, transition: 'fadeIn'
, appendTo:'body'
, closeClass: 'b-close'
, modalClose: true
, modalColor: '#fff'
, model: false
,escClose:true
, position: ['auto', 42] //x, y
, onClose: function(){
console.log('closed');
var myPlayer = videojs('look_video');
myPlayer.pause();
}
});
$("video").trigger("play");
});

关于javascript - bpopup onClose 回调事件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25306249/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com