• 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

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 1 replies (of 1 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @chriswebdev – It would probably help if you linked to a Gist or a Pastebin of the entire code / script you are using for reference as from what you are describing so far I would expect things to work in theory.

    Thanks!

    – Cais.

Viewing 1 replies (of 1 total)
  • The topic ‘Refresh lightbox initialization after elements are added w/ajax callback’ is closed to new replies.