Need a little help with this jQuery portfolio-style gallery.
As you can see there is a main image with a related caption and other small images below. If you click one of them the main image/caption changes to display the one you selected. If you notice when you hover the pointer on any of the images below the big one you get a link like test.php/#image3 or test.php/#image6.
I'm looking for a way to have that if you visit test.php/#image3 (directly, not through the onClick event) you have the #image3 as main image (so without having to click on it). The same for test.php/#image4 / #image5, etc.
The gallery uses the Galleriffic plugin for jQuery...
This is a small piece of the code:
Code: [Select]
I think I need a script that adds onLoad the same even that happens onClick, using window.location.hash; to match the part after the # with the image.
As you can see there is a main image with a related caption and other small images below. If you click one of them the main image/caption changes to display the one you selected. If you notice when you hover the pointer on any of the images below the big one you get a link like test.php/#image3 or test.php/#image6.
I'm looking for a way to have that if you visit test.php/#image3 (directly, not through the onClick event) you have the #image3 as main image (so without having to click on it). The same for test.php/#image4 / #image5, etc.
The gallery uses the Galleriffic plugin for jQuery...
This is a small piece of the code:
// Global function that looks up an image by its hash and displays the image.
// Returns false when an image is not found for the specified hash.
// @param {String} hash This is the unique hash value assigned to an image.
gotoImage: function(hash) {
var imageData = $.galleriffic.getImage(hash);
if (!imageData)
return false;
var gallery = imageData.gallery;
gallery.gotoImage(imageData);
return true;
},
I think I need a script that adds onLoad the same even that happens onClick, using window.location.hash; to match the part after the # with the image.