Highslide JS API Reference

Close Move
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dapibus leo quis nisl. In lectus. Vivamus consectetuer pede in nisl. Mauris cursus pretium mauris. Suspendisse condimentum mi ac tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec sed enim. Ut vel ipsum. Cras consequat velit et justo. Donec mollis, mi at tincidunt vehicula, nisl mi luctus risus, quis scelerisque arcu nibh ac nisi. Sed risus. Curabitur urna. Aliquam vitae nisl. Quisque imperdiet semper justo. Pellentesque nonummy pretium tellus.
Resize

Object: hs

Variables

Functions

Events

Object: hs.Expander

Variables

Functions

Events



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

New, Edit