Support » Plugin: Advanced AJAX Page Loader » NextGEN Gallery Slideshow; Let's solve this together.

  • Resolved David Bitton


    As we all are familiar, the NextGEN slideshow doesn’t work correctly when using AAPL. I spent some time looking into the code, and it really comes down to this snippet of HTML from the actual page:

    <div id="ngg-slideshow-3-986-1" class="ngg-slideshow" style="height:675px;width:900px;">
    	<div id="ngg-slideshow-3-986-1-loader" class="ngg-slideshow-loader" style="height:675px;width:900px;">
    		<img src="" class="ov-done" width="66" height="66" alt="" />
    <script type="text/javascript" defer="defer">
    jQuery("#ngg-slideshow-3-986-1").nggSlideshow( {id: 3,fx:"fade",width:900,height:675,domain: "",timeout:4000});

    NextGEN outputs this snippet for each shortcode found within the page/post. That goes for the script block as well. Then the deferred script relies on the document being ready. Well, the page is only ready once. The subsequent AJAX calls do not result in this event being fired again. Also, you can’t re-fire the ready event.

    The solution may come down to using jQuery to hunt down the code, and try and figure out a way to call the code in the ready event callback. Ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Here is the necessary reload code for NextGEN slideshows:

    var slideshows = jQuery("[id^=ngg-slideshow]");
    	var d = slideshows.eq(i);
    	var s =;
    	var h = s.html();
    	var c = h.split("\n")[2];
    	console.log("Evaluating:\r\n" + c);

    Whoops. change the selector to:

    var slideshows = jQuery(".ngg-slideshow");

    is was also grabbing the loader div.

    Weird, that code was working up until a few days ago. Now it doesn’t anymore. No updates were done, anyone know why it suddenly stopped?

    Did NextGEN release an update?

    Yes, they just updated the NextGen Plugin and now the reload code no longer works. :/ I’ve reverted the plugin back to the old version for now. Anyone figure out the new reload code??

    I started working on it. It comes down to the fact that 2.0.x only inserts <script/> tags in <head/> on pages with slideshows. So I now have to figure out how to extract that in the Data Ajax Loaded Code. This isn’t going to be easy.

    What I did to make Nextgen run with ajax loaded content (AAPL in my case as well) – it’s a really ugly solution – but it works with Nextgen 2 and my installation:
    I inserted one Nextgen gallery into footer code (through shortcode) so I know it is executed on every page one can enter.
    Then I used CSS and set “display: none;” to the container’s CSS style to hide it for all pages.
    All Nextgen javascripts are loaded in head now and all functionality started to work.

    Why does this work?
    If I do load content with ajax head is not modified – only the content, so if first page I open through browser ULR bar doesn’t include Nextgen gallery, then the necessary scripts are not loaded into my website.
    You can make sure if you do have the same problem as me by typing in browser’s URL Bar the address to the page that has Nextgen gallery inserted (Nextgen will add the javascripts to head then, if You start with a page that doesn’t have Nextgen gallery it won’t work when You ajax-change your page to one with gallery).

    I did find load codes for AAPL but as in other cases they must have stopped working at some point.

    Adding the small gallery to the bottom of the page so that it shows on all pages doesnt work for me. Having the small gallery makes the styling for the thumbnails load, but thats it. The lightbox effect doesnt work, it just goes to the image link.

    Ohh this is for the slideshow, not the thumbnail gallery. Doi! I just had to load the lightbox-init javascript file to get it to work.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘NextGEN Gallery Slideshow; Let's solve this together.’ is closed to new replies.