user2592821
user2592821

Reputation: 1

Highslide: Opening a webpage instead of expanding an image

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

Answers (2)

RoadRash
RoadRash

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

suff trek
suff trek

Reputation: 39777

Just a guess but try

onclick = "window.open('http://www.yoururl.com')";

Upvotes: 0

Related Questions