Reputation: 1
Is there any way to simply open a web page when an image in the gallery is clicked instead of expanding the image on the page? I'm sure that the solution - if there is one - would probably require changing the following code:
onclick="return hs.expand(this, inPageOptions )
Upvotes: 0
Views: 841
Reputation: 881
See this demo gallery: http://jsfiddle.net/roadrash/KtDpz/
Use hs.Expander.prototype.custom to set the URL you want to open when clicking each image in the gallery:
onclick="return hs.expand(this, inPageOptions, {url: 'http://roadrash.no/'})"
Replace the hs.Expander.prototype.onImageClick
code with this:
// go to url when clicking the image
hs.Expander.prototype.onImageClick = function() {
if (this.custom) {
window.open(this.custom.url);
}
return false;
};
Upvotes: 1
Reputation: 39777
Just a guess but try
onclick = "window.open('http://www.yoururl.com')";
Upvotes: 0