Object: hsVariables
Functions
EventsObject: hs.ExpanderVariablesFunctionsEvents
|
hs.Expander.prototype.onInitFires 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
Parameters
ExampleAlert the expander propertiesIn 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. |