I am using Infinite scroll and am already using callback for Magnific Popup.
The code for JWPlayer is in HTML, which looks like it also needs a callback to work outside of page 1, but I'm not sure how to do this, since it is only in 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 with 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>
source
share