Refresh lightbox initialization after elements are added w/ajax callback
-
Hi, I am adding lightbox elements ina an ajax callback using your plugin.
I wouldn’t want to paste the ngg-gallery markup that is being loded in ajax callback, but the markup is being generated with
do_shortcode('[nggallery id='. $gallery_id .']')
This returns the markup as expected, however, when the thumbnail is clicked, the thumbnail image is opened in a new tab in original size format. From my little experience working with javascript, I believe that the element has not be set as a lightbox element. Therefore I went through the loaded scripts and found the
jquery.lightbox/nextgen_lightbox_init.js
script. I thought that by calling
nextgen_jquery_lightbox_init()
after the elements are added, it would work, however, it still won’t.Please note that with other lightbox elements which are initiated on page load, it works as expected.
Can someone help me figure out how to initialize an element with lightbox/nextgen script, after elements are appended with ajax!? thanks
- The topic ‘Refresh lightbox initialization after elements are added w/ajax callback’ is closed to new replies.