WordPress.org

Ready to get started?Download WordPress

Forums

Lightbox Plus ColorBox
[Plugin: Lightbox Plus] Infinite scroll issue (2 posts)

  1. ale152
    Member
    Posted 1 year ago #

    Hi!
    I'm using this plugin with infinite scroll, which loads new images in a page.
    How can I update images list in order to make lightbox plus work with these new images?

    Thank you.

    http://wordpress.org/extend/plugins/lightbox-plus/

  2. ale152
    Member
    Posted 1 year ago #

    I found that if I call, from firebug console, this code:
    $("a[rel*=lightbox]").colorbox({maxHeight:"100%",opacity:0.8,slideshow:true,slideshowAuto:false,slideshowSpeed:2500,slideshowStart:"start",slideshowStop:"stop"});
    the lightbox list of images will update with the new images!
    The problem is that if I call this code from within the infinite scroll callback, it doesn't work!

    This is my infinite scroll callback:

    $('#sort').infinitescroll({
     /// ... ... ... ///
    },function( newElements ){
    var $newElems = $( newElements );
    $newElems.css('position', 'absolute');
    $newElems.css('margin', '10px');
    console.log($newElems);
    $('#sort').masonry( 'appended', $newElems, true );
    $("a[rel*=lightbox]").colorbox({maxHeight:"100%",opacity:0.8,slideshow:true,slideshowAuto:false,slideshowSpeed:2500,slideshowStart:"start",slideshowStop:"stop"});
    });

    What am I doing wrong?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.