Galleriffic — Linking to specific image in gallery

2019-09-14 08:04发布

问题:

If the title isn't clear enough I'll go into some detail here.

I've created multiple galleriffic galleries each on different html pages, each gallery consisting of 5-25 images. What I would like is to implement a drop down menu where a user can jump to any specific image in any gallery. However this doesn't seem to work. I tried creating a form which links to the # generated by galleriffic, but can't seem to figure out how to make the image get called. Whenever I try it simply loads the first image in the gallery.

I'm not overly proficient with jQuery or PHP, and I know I need some trickery with these languages to work.

Below are examples of the index page, and another page I'm trying to call.

https://s3-us-west-1.amazonaws.com/integra2010/optics/index.html https://s3-us-west-1.amazonaws.com/integra2010/optics/butterscotch.html

The drop down menu currently contains just 3 links, which I want to load image 3,4,5 on the butterscotch page.

Any help would be greatly appreciated.

Thank you!

回答1:

rename butterscotch.html to butterscotch.php and add to script after .galleriffic()

<?php
$id = strrchr($_SERVER['REQUEST_URI'], '#');
if ($id) echo "$('#thumbs a[href=\"{$id}\"]').click();";
?>