sylaxo
Posts: 4
Joined: Sun Jan 03, 2016 3:17 pm

[solved]Opening a new page on closing a gallery

Hi,
I would like the user to go to a specific web page when he closes a gallery, even if he left the gallery before viewing all of the images.
Thanks
Last edited by sylaxo on Sun Jan 03, 2016 6:30 pm, edited 1 time in total.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Opening a new page on closing a gallery

You should be able to use the onAfterClose event:

Code: Select all

hs.Expander.prototype.onAfterClose = function() {
   if (this.isClosing) {
      location.assign("http://example.com");
   }
}
Make sure you're using highslide-full.js or highslide-full.min.js, since this requires "events."
sylaxo
Posts: 4
Joined: Sun Jan 03, 2016 3:17 pm

[solved] Opening a new page on closing a gallery

MisterNeutron wrote:You should be able to use the onAfterClose event:

Code: Select all

hs.Expander.prototype.onAfterClose = function() {
   if (this.isClosing) {
      location.assign("http://example.com");
   }
}
Make sure you're using highslide-full.js or highslide-full.min.js, since this requires "events."
It's MAGIC !
Thanks a lot.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: [solved]Opening a new page on closing a gallery

Glad that worked. I confess that I didn't test it! :)

Return to “Highslide JS Usage”