You need to remove the double slash // in front of the slideshowGroup
I am confused. I thought that it was hs.onSetClickEvent that was there to associate hs with the gallery. That's what I thought I did with this:
Code: Select all
return hs.expand(this, { slideshowGroup: 'picThumbs'});
The hs.addSlideshow code is there from some example. I thought I needed it. Is this what causes my HTML popup to display the gallery nav bar?
(This is my remaining problem at this moment.)
That's one issue.
The other one is what you mentioned at the end. On the page I am working on right now there's only one gallery. Another one will contain many galleries. However, I won't be able use slideshowGroup: ['group1', 'group2', 'group3'] because I won't know names of the groups in advance. They'll be produced dynamically. So, I was going to use
Code: Select all
hs.onSetClickEvent = function ( sender, e ) {
// set the onclick for the element, output the group name to the caption for debugging
e.element.onclick = function () {
return hs.expand(this, { slideshowGroup: this.parentNode.className,
captionText: this.parentNode.className });
}
// return false to prevent the onclick being set once again
return false;
}
Note how this code sets the value of slideshowGroup. This will allow my to have groups without hardcoding their names in advance.
Update: slideshowGroup: this.parentNode.className won't help me because the parent element will be a div that will be inside a td that will be inside tr, etc. The unique element will be pretty far from the link element. So, I will have to do something like this:
Code: Select all
this.parentNode.parentNode.parentNode.parentNode.className
. This is ugly and costly to maintain. Can I use jQuery to locate the node and pass it to HS somehow? Probably so -- by storing the class name in a variable and then passing the variable to the expand method.