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.getExpander

Get a hs.Expander object by id, by a DOM element or get the active expander.
hs.Expander hs.getExpander ( [mixed param] )
The getExpander function is designed to return the correct element almost whatever you throw at it, as shown below.

Details

Type function
Returns hs.Expander

Parameters

param
  1. If param is null, the function returns the currently active (focused) element or null if no expander is open.
  2. If param is a string, the function first looks for elements by that id within an opened expander and returns that expander. If that fails, the function looks for an anchor by that id or a thumbnail image by that id and returns the expander that this thumbnail has opened. If these two cases fail, it returns null.
  3. If param is a DOM element, the function looks for suiting elements by the same rules as if it were a string.

Example

Getting hs.Expander info from the caption

In this case this refers to the h1 element itself, and getExpander returns the hs.Expander the caption is a part of. It alerts the href attribute of the anchor that opened the hs.Expander.

<div class="highslide-caption">
   <h1 onclick="alert(hs.getExpander(this).a.href)">Click me</h1>
</div>

Try it

Click me

New, Edit