3

壮大なポップアップでビデオ ギャラリーを作成しました。

しかし、イメージ ギャラリーとは異なり、ビデオ ギャラリーにはカウンター(ビデオの右下に1/3など) が表示されません。なぜだめですか?画像ギャラリーではうまく機能します。

ビデオギャラリーのコード:

$('.gallery_video').each(function() { // the containers for all your galleries
    $(this).magnificPopup({
        delegate: 'a', // the selector for gallery item
        disableOn: 700,
        type: 'iframe',
        mainClass: 'mfp-fade',
        removalDelay: 160,
        preloader: true,
        fixedContentPos: false,
        gallery: {
          enabled:true
        },
        callbacks: {
      lazyLoad: function(item) {
        console.log(item); // Magnific Popup data object that should be loaded
      }
    }
    });
}); 

画像ギャラリーのコード:

$('.image-popup-no-margins').magnificPopup({
    type: 'image',
    closeOnContentClick: true,
    closeBtnInside: true,
    fixedContentPos: true,
    mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
    image: {
        verticalFit: true
    },
    zoom: {
        enabled: true,
        duration: 300 // don't foget to change the duration also in CSS
    },
    callbacks: {
      lazyLoad: function(item) {
        console.log(item); // Magnific Popup data object that should be loaded
      }
    }
});

どちらのスクリプトもカウンターを指定していないのに、両方に表示されないのはなぜですか?

ありがとうございました

4

2 に答える 2

0

それを理解しました-iframeタイプの場合、カウンターが必要であることを指定する必要があります:

$(this).magnificPopup({
.....
iframe: {
             markup: '<button title="Close (Esc)" type="button" class="mfp-close">×</button>'+
                '<div class="mfp-counter"></div>'
}
于 2014-08-06T18:38:37.607 に答える