1

回调事件不是通过模式,关闭按钮和 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();
                   }});

                });
4

1 回答 1

2

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

$('.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");
            });
于 2014-11-19T18:11:56.753 回答