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

Fires when the thumbnail is clicked and the primary properties of the expander are set.
boolean hs.Expander.prototype.onInit ( hs.Expander sender )

The onInit event happens before the expander starts modifying the page in any way. All the hs.overrides parameters as well as references to hs.Expander.prototype.a, hs.Expander.prototype.thumb and hs.Expander.prototype.custom are available at this time. Returning false cancels the expander.

The onInit event is a good place to set size options like hs.marginLeft, hs.marginRight or this.maxWidth, this.minWidth. Note that setting global (hs) values for options that are inherited to the Expander object - see hs.overrides - will have no effect at this stage, because those options are already copied over. For example, setting hs.marginLeft will have an effect, but hs.maxWidth will not. Instead, the value must be set directly on the Expander, this.maxWidth.

Details

Requires events
Type event
Returns boolean

Parameters

sender
The sender object in this context is the hs.Expander instance.

Example

Alert the expander properties

In this example we alert the expander properties at the onInit time, and give the user an option to continue or cancel.

Put this code in the head section of your page:

<script type="text/javascript">
hs.Expander.prototype.onInit = function (sender) {
   var s = "The current properties of sender:\n\n";
   for (var x in sender) {
      if (typeof sender[x] != "function")
         s += x +": "+ sender[x] +"\n";
   }
   s += "\nClick OK to continue, or Cancel to cancel the expander."
   return confirm(s);
}
</script>

Below is the example in action.

New, Edit