次のようなアイテムの配列があります。
items: [
{
src: '#white-popup0',
type: 'inline'
},
{
src: '#white-popup1',
type: 'inline'
},
{
src: '#white-popup2',
type: 'inline'
}]
そして、その配列に一致するいくつかの html コンテンツは、次のようになります。
<div id="white-popup0" class="white-popup">
<div class="popup_social_buttons">
<iframe src="//www.facebook.com/plugins/like.php"><!-- FB like button --></iframe>
<a href="//www.pinterest.com/pin/create/button/"><!-- Pinterest button --></a>
<div id="___plusone_3" ><!-- G+ button --></div>
</div>
<img alt="alt text here" src="some_picture.jpg" class="img-responsive">
<button title="Close (Esc)" type="button" class="mfp-close">×</button>
</div>
html コンテンツは、すべての「#white-popup」で同じ構造になっています。ここで、magnific-popup を開く方法は、配列のようにまったく同じ量のアイテムがあるブートストラップ カルーセルから .magnificPopup 関数をトリガーすることです。私のjs配列から特定のアイテムをトリガーする何かをする必要があります。たとえば、カルーセルの 2 番目の項目をクリックすると、.magnificPopup ですべての項目が開きますが、2 番目の項目から始まります。
前もって感謝します。