2
我正在使用Magnific Popup庫。當點擊鏈接時,我需要有下一個最接近的popup-div-content加載。它適用於硬編碼的ID,但我需要它一般工作(下一步),因爲這是進入一個CMS,我不知道有多少項目正在加載。選擇下一個彈出與Magnific Popup(jQuery)
<a href="#" class="open-popup-link">1st link</a>
<div class="white-popup mfp-hide">
<p>First popup content</p>
</div><br>
<a href="#" class="open-popup-link">2nd link</a>
<div class="white-popup mfp-hide">
<p>Second popup content</p>
</div><br>
<a href="#" class="open-popup-link">3nd link</a>
<div class="white-popup mfp-hide">
<p>Third popup content</p>
</div>
$('.open-popup-link').magnificPopup({
items: {
// src: $('.white-popup'), // works but loads all
src: $(this).next('.white-popup'), // should load only next popup div
type: 'inline'
}
});
小提琴:http://jsfiddle.net/BinaryAcid/XadjS/2/