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

Fires when at least one expander is open and a key is pressed.
bool hs.onKeyDown(object sender, object e)
By default Highslide interacts on the following keys, with the keyCode in parenthesis:
Page Down (34), Arrow right (39), Arrow down (40)
Open the next thumbnail.
Page Up (33), Arrow left (37), Arrow up (38)
Open the previous thumbnail.
Escape (27), Enter (13)
By using the hs.onKeyDown event, you can do your own actions based on the user's keystroke or you can cancel some of the default key codes. Return false to cancel any action. To get the active expander in this context, use hs.getExpander().

Details

Requires navigation, events
Type event
Returns bool

Parameters

sender
The sender object in this context is the hs object.
e
The normalized event arguments passed on from the window.onKeyDown event. Normalized means that Internet Explorer understands the arguments, and that e.target is set also in IE.

Example

Output the entered key code to the caption

We return false to prevent Highslide from doing the default actions. This also means that since Highslide is not capturing the event, for example Page Up will do the browser's default action. Put this in the head section of your HTML page:

<script type="text/javascript">
hs.onKeyDown = function (sender, e) {
   var exp = hs.getExpander();
   exp.caption.innerHTML = "You just hit the key with the following key code: <b>"+ e.keyCode +"</b";
   return false;
}
</script>

Open the expander and hit any key to see the results:

Hit any key
New, Edit