WordPress.org

Ready to get started?Download WordPress

Forums

WP-prettyPhoto
wp-prettyphoto & nextgen ajax pagination hack (1 post)

  1. Bozz
    Member
    Posted 3 years ago #

    I am using wp-prettyPhoto to open lightbox style windows automatically on all links to images. It works great on static pages, but not on dynamic AJAX-reloaded content. In my case, when I click 'Next', the prettyphoto functionality is broken. If I refresh the page, it works fine.

    I am using Nextgen Gallery with AJAX pagination enabled. Currently, only shutterbox is supported for this, but you can trick nextgen into thinking shutterbox is enabled, but put your own link code in. I use

    rel="wp-prettyPhoto[%GALLERY_NAME%]"

    The AJAX is working, but prettyPhoto needs to run again after the AJAX comes back. I have looked for hours at answers, and they all seem to suggest to place the following into the AJAX callback:

    $(document).ready(function(){
    $("a[rel^='wp-prettyPhoto']").prettyPhoto();
    });

    and/or

    $(".ppt").remove();
    $(".pp_overlay").remove();
    $(".pp_pic_holder").remove();

    however, no matter where I've tried to stick this code in ngg.js, I can't get prettyPhoto to refresh properly after using the AJAX navigation in nextgen.

    does anyone know the best place to put these into the nextgen AJAX callback, or is it an error in my code?

    here is some additional helpful info:
    http://forums.no-margin-for-errors.com/discussion/300/problems-prettyphoto-with-ajax-and-php/p1

    here is a link to the gallery (which uses thumbnails) :
    http://bit.ly/fQ4xmr

    Thank you for your thoughts on this!
    Steve

    http://wordpress.org/extend/plugins/wp-prettyphoto/
    http://wordpress.org/extend/plugins/nextgen-gallery/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic