【发布时间】:2017-10-04 16:54:01
【问题描述】:
我正在使用无限滚动并且已经在使用 Magnific Popup 的回调。
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,
}
});
});
}
});
带有 JWPlayer 的 HTML:
<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>
【问题讨论】:
-
您是否尝试过将脚本移动到单独的文件并将其包含到您需要的所有页面中?
标签: jquery callback jwplayer infinite-scroll