hs.Expander.prototype.custom
A custom object that is passed to the hs.Expander from the hs.expander function.
Used within the hs.Expander object, this.custom
refers to the passed over object.
Details
Type |
mixed |
Default value |
undefined |
Overrideable inline |
No |
Example
Replace text in the caption.
This example requires that events are enabled in the download configuration. What we will do is to pass two custom variables into the hs.Expander, and display them in the caption.
1. Define the event handler in the head section of your page.
hs.Expander.prototype.onAfterGetCaption = function () {
this.caption.innerHTML = this.caption.innerHTML.replace("{foo}", this.custom.foo);
this.caption.innerHTML = this.caption.innerHTML.replace("{bar}", this.custom.bar);
}
2. Mark up the thumbnail and the caption, with a custom object and slots for the replacements in point 1.
<a class="highslide" href="../samples/full3.jpg"
onclick="return hs.expand(this, null, { foo: 'Happy', bar: 'coding' } )">
<img src="../samples/thumb3.jpg" alt=""/>
</a>
<div class="highslide-caption">
The Highslide author says "{foo} {bar}!"
</div>
The effect:
The Highslide author says "{foo} {bar}!"
See also