I have a view that displays a gallery of image thumbnails. Setting up each of them to open in a Shadowbox works fine but I want to add a separate link somewhere on the page that starts a slideshow as if I clicked on the first image. In lightbox you can do:

<a href="#" onclick="Lightbox.triggerLightbox('lightshow', 'groupname');">Start Slideshow</a>

Can you do something like that with Shadowbox?

Comments

psynaptic’s picture

Status: Active » Needs work

If lightbox2 has this feature it should be easy to create a patch for this module. Can anyone provide one?

Alex Andrascu’s picture

subscribing

Alex Andrascu’s picture

Solved my problem like this:
I've needed to open the shadowbox for the field_photo when you click on node title.

<a <?php print $node->field_photo[0]['filepath']==''?'':'rel="shadowbox"'; print $node->field_photo[0]['filepath']!=''?'href="'.$base_path.''.$node->field_photo[0]['filepath'].'"':''; ?> title="<?php print $title ?>"><?php print $title; ?></a>

Can be shaped to fit other needs too. Hope it helps someone.

nicholas.alipaz’s picture

It seems this is related to slideshowDelay, if it is set then the gallery can proceed to the next piece of content automatically. See http://www.shadowbox-js.com/options.html

We could create some sort of interface to the option in the administration, but I am not completely sure how/where it would make most sense.

Try:

<a href="/myphoto.jpg" rel="shadowbox[mygallery];slideshowDelay=3;">see the slideshow</a>

Where the photo linked is part of multiple images all with the same shadowbox attribute.

manfer’s picture

Status: Needs work » Fixed

In shadowbox module configuration we can configure the slideshow delay. If it is set to a positive number the slideshow will autostart. This will be a global option for every gallery.

Then to create a gallery and a text link that opens that gallery would be something like this:

<a href="image1.jpg" id="mygallery" rel="shadowbox[mygallery]"><img src="image1thumb.jpg" /></a>
<a href="image2.jpg" rel="shadowbox[mygallery]"><img src="image2thumb.jpg" /></a>
<a href="image3.jpg" rel="shadowbox[mygallery]"><img src="image3thumb.jpg" /></a>
<a href="#" onclick="Shadowbox.open(document.getElementById('mygallery'))">Open Slideshow</a>

We have to be sure to include this code in a post using the Full HTML filter or otherwise with the filtered HTML will fail.

If we don't want the autostart slideshow option globally then the only way to proceed is making more in depth use of the shadowbox library functions. Probably using buildObject to set options (slideshow delay) to that specific gallery or setup.

Take a deeper look into the shadowbox library API functions.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.