WordPress.org

Ready to get started?Download WordPress

Forums

Advanced AJAX Page Loader
[resolved] NextGEN Gallery Slideshow; Let's solve this together. (7 posts)

  1. David Bitton
    Member
    Posted 9 months ago #

    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="http://xxxxxxxxxxxxxx.cloudfront.net/wp-content/plugins/nextgen-gallery/images/loader.gif" class="ov-done" width="66" height="66" alt="" />
    	</div>
    </div>
    <script type="text/javascript" defer="defer">
    jQuery(document).ready(function(){
    jQuery("#ngg-slideshow-3-986-1").nggSlideshow( {id: 3,fx:"fade",width:900,height:675,domain: "http://abc.def.com/",timeout:4000});
    });
    </script>

    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?

    http://wordpress.org/extend/plugins/advanced-ajax-page-loader/

  2. David Bitton
    Member
    Posted 9 months ago #

    Here is the necessary reload code for NextGEN slideshows:

    var slideshows = jQuery("[id^=ngg-slideshow]");
    
    for(i=0;i<slideshows.length;i++){
    	var d = slideshows.eq(i);
    	var s = d.next();
    	var h = s.html();
    	var c = h.split("\n")[2];
    	console.log("Evaluating:\r\n" + c);
    	eval(c);
    }
  3. David Bitton
    Member
    Posted 9 months ago #

    Whoops. change the selector to:

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

    is was also grabbing the loader div.

  4. kings3jm
    Member
    Posted 8 months ago #

    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?

  5. David Bitton
    Member
    Posted 8 months ago #

    Did NextGEN release an update?

  6. kings3jm
    Member
    Posted 7 months ago #

    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??

  7. David Bitton
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic