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>
您是否嘗試將腳本移動到單獨的文件並將其包含到所需的所有頁面? – VTodorov