我有一個項目數組,看起來是這樣的:莊重,彈出打開某些項目
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」具有相同的結構。 現在,我打開magnifica-popup的方式是通過從引導程序傳送帶觸發.magnificPopup函數,其中我有與我的數組中相同數量的項目。我需要做些什麼來觸發我的js數組中的某個項目。例如,如果我點擊我的旋轉木馬上的第二個項目,我會讓.magnificPopup打開所有項目,但是從第二個項目開始。
在此先感謝。
這正是我一直在尋找,非常感謝。 – dustfeather