2017-10-04 89 views
4

我正在使用无限滚动并已经使用Magnific Popup的回调。带JWPlayer的无限滚动 - 回调

JWPlayer的代码是在HTML中看起来像它也需要一个回调工作超出第1页,但我不知道如何去做这件事,因为它只是在HTML中。

$grid.infiniteScroll({ 
    path: '.pagination__next', 
    append: '.grid__item', 
    outlayer: msnry, 
    status: '.page-load-status', 
    onInit: function() { 
    this.on('append', function() { 
    $('.open-pop').magnificPopup({ 
    type: 'inline', 
    mainClass: 'mfp-fade', 
    fixedContentPos: false, 
    gallery: { 
    enabled: true, 
    navigateByImgClick: false, 
    } 
    }); 
    }); 
} 

}); 

HTML与JWPlayer:

<script type="text/javaScript"> 
    var playerInstance = jwplayer("myElement-{{ entry.mediaId }}"); 
    playerInstance.setup({ 
    file: "//content.jwplatform.com/videos/{{ entry.mediaId }}.mp3", 
    image:"http://content.jwplatform.com/thumbs/{{ entry.mediaId}}.jpg", 
    stretching:"fill", 
    mediaid: "{{ entry.mediaId }}" 
    }); 
    </script> 
+0

您是否尝试将脚本移动到单独的文件并将其包含到所需的所有页面? – VTodorov

回答