superbox icon indicating copy to clipboard operation
superbox copied to clipboard

Superbox in a callback function

Open macsupport opened this issue 12 years ago • 8 comments

I'm making an image gallery using Superbox and I am using infinitescroll to load images. For super box to work it needs a callback after the new images are loaded. Like this:

function( newElements ) {
$('#container').SuperBox();
}

I've done this with different lightbox scripts, jQuery isotope and packery etc but having trouble with super box. After this callback, I get either double images or a quick open and close on my initial group of images (usually after the second loading of images). Is there any way to do this callback so i don't get this error? I need to basically reload super box. Here is a Demo. Still working on the search function!

macsupport avatar Jun 15 '13 02:06 macsupport

I see a number of divs generated in the DOM that will certainly make this tough. Some of that (like the superbox-float) is created by superbox and some of that created elsewhere. I'll have to dig into this when I have more time.

seyDoggy avatar Jun 20 '13 10:06 seyDoggy

Same problem here, with a reload of superbox after I added more pictures. Great script besides this!

lggwettmann avatar Feb 09 '14 16:02 lggwettmann

Oh, here is my link http://alpha.circlerotterdam.nl/html/media.php

lggwettmann avatar Feb 09 '14 16:02 lggwettmann

Can we perhaps just get a hint how to do this ourselves..? I really like superbox and implemented it so far.. but this throws me off and I'd have to restart with another -uglier- script which would be a pity and mean that I lost a lot of time. Any glimpse is helpful. Thanks.

lggwettmann avatar Mar 15 '14 13:03 lggwettmann

Can you zip a a sample of what you're trying to do? I'm fairly removed from this project at the moment but @NimbleHost may have a vested interest in making this work now.

seyDoggy avatar Mar 15 '14 13:03 seyDoggy

Hey seyDoggy, hey @nimblehost, that would be great.

My example is still online. It works if you click on the first batch of pics, but if you load more pics, they won't show up in the grey lightbox (my pics in the lightbox are encoded, thats why they look so weird).

Basically I can either call .Superbox everytime I have a ajax-load of new elements (and it messes everything up) or I don't call Superbox anymore but then the newly ajax-loaded part of the gallery won't open the lightbox.

Thank you.

lggwettmann avatar Jun 13 '14 09:06 lggwettmann

Any updates or alternative scripts perhaps you know about? thank you.

lggwettmann avatar Jul 02 '14 01:07 lggwettmann

It will take me some time before I can take a look at this. Appreciate your patience!

NimbleHost avatar Jul 03 '14 21:07 NimbleHost