Passing an array of 'imaginary' links to Shadowbox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing an array of 'imaginary' links to Shadowbox

schmoove
Hi everyone,

First up- Shadowbox is brilliant and I have been clamouring to incorporate it into one of my projects, but have hit a nasty snag.

The problem is I'm executing Shadowbox from a mootools carousel which is adding/removing links on the fly, and Shadowbox can only see those which are on the current slide - that means it will only have 1 of 5 in the gallery, instead of 1 of 15 and you cant cycle between pictures across slides.

Slimbox, the script I was using until now had an undocumented feature where you could pass an array of links manually like this:

lightbox.open(['image1.jpg','image2.jpg','image3.jpg'])

, and then launch each one from an onclick event in the href, referencing it's index in the array (onclick="showImage(3)"). This way you could force it to open images which werent currently registernig in the DOM. Does that make sense?

So, I was hoping Shadowbox could do something similar. Obviously it would be done using the skipSetup method, but it seems that Shadowbox is always looking for links in the DOM and will error if it cant find them.

Any suggestions would be greatly appreciated - I'd really like to use Shadowbox and only Shadowbox from now on!

Cheers,

Ryan
Reply | Threaded
Open this post in threaded view
|

Re: Passing an array of 'imaginary' links to Shadowbox

mjijackson
Administrator
Could you just use

Shadowbox.open({
    type: 'img',
    content: 'image1.jpg'
});

?
Reply | Threaded
Open this post in threaded view
|

Re: Passing an array of 'imaginary' links to Shadowbox

schmoove
That would just open the one file though right? If I could setup using this syntax:

Shadowbox.setup({
    type: 'img',
    gallery: 'myGallery',
    content: ['image1.jpg','image2.jpg','image3.jpg']
});


And then launch each one from an onclick somehow (possibly referencing the index of the array?), but still have them linked as a gallery within the shadowbox window that'd be perfect.

But from the docs it doesn't look like this is possible - any ideas would be much appreciated, cheers!

Ryan
Reply | Threaded
Open this post in threaded view
|

Re: Passing an array of 'imaginary' links to Shadowbox

ashish.sharma-3
The "gallery" is not working in Shadowbox.open() function as it is not grouping the images.


Can you / anyone help me in this?

Thanks