javascript - magnificpopup/lightbox only fires once -


i have read similar things on stackoverflow, not getting anywhere. use magnificpopup lightbox display excursion details , photos.it works fine on first click, fails fire again unless page refreshed. obviously, won't work! here code/calls. can assist?

the code clicked: blah, blah excursion name

here js settings:

var lb_settings = {     type: 'inline',     fixedbgpos: true,     closebtninside: true,     preloader: false,     removaldelay: 300,     mainclass: 'my-mfp-zoom-in',     callbacks: {         close: function() {             // need stop cycle when no longer in dom             var $lb = $(".cc_lightbox_slideshow");             if ($lb.length) {                    $lb.cycle('destroy');             }         }     } }; 

and lastly actual click function:

$("code").click(function () {     var href = "/trips/getoptiondetails/acct_id/" +$(this).attr("class") + "/year/" + programyear + "/program/" + program;     lb_settings.items = {};     lb_settings.items.src = href;     lb_settings.items.type = 'ajax';     $.magnificpopup.open(lb_settings); }); 

i'd grateful help. i'm @ loss.

this way way easier though. i'm finding previous developer has real knack on complicating things.

i changed ajax call simply:

$('.magpopup').magnificpopup({ type: 'ajax' });

then used simple html href such:

a href="linkwithurlparameters" class="magpopup">link text

lastly, switched lightbox settings , calls run directly file being called. voila!

thanks everyone.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -