javascript - Multiple instances of jQuery plugin (Magnific popup) -
i've hit bit of wall one. jquery knowledge outside of implementation pretty poor.
i'm building magnific popup (http://dimsemenov.com/plugins/magnific-popup/) jquery plugin wordpress theme popup gallery. i've got wired , working. grabs images dynamically backend using custom fields. can multiple instances working on same page. however, when scrolling through images in 1 popup gallery, wont end @ end of first gallery rather, move on images in second gallery. see example: http://www.oftenvisual.com/reset/galleries/.
unfortunately can't post code here it's long, demo page helps. because galleries generated dynamically , client using backend wont have knowledge add container different classes, need way dynamically separate out galleries. idea appreciated!
script calling plugin
// magnific $(document).ready(function() { $('.popup-gallery').magnificpopup({ delegate: 'a', type: 'image', tloading: 'loading image #%curr%...', mainclass: 'mfp-img-mobile', gallery: { enabled: true, navigatebyimgclick: true, preload: [0,1] // preload 0 - before current, , 1 after current image }, image: { terror: '<a href="%url%">the image #%curr%</a> not loaded.', titlesrc: function(item) { return item.el.attr('title'); } } }); });
try set different id_s on .popup-gallery div's , do
$('#popup-gallery1').magnificpopup.... $('#popup-gallery2').magnificpopup....
Comments
Post a Comment