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

Fires after the HTML content is grabbed.
void hs.Expander.prototype.onAfterGetContent ( hs.Expander sender )
At this time, Ajax loaded content and iframes are injected into the DOM, and edits and replacements to the content can be done before it is displayed. The content div can be accessed through sender.content.

Details

Requires events, html
Type event
Returns void

Parameters

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

Example

Replacing text in the content

This example shows how to edit the self-rendered content wrapper. We will add a custom button at the end of the controlbar unordered list.

Put this in the head section of your page:

<script type="text/javascript">
hs.Expander.prototype.onAfterGetContent = function (sender) {   
   // get the controlbar
   var ul = sender.content.getElementsByTagName("ul")[0];

   // create a list item
   var li = document.createElement("li");
   ul.appendChild(li);

   // create an anchor
   var a = document.createElement("a");
   a.href = "javascript:alert('I am a custom button')";
   
   // create a text node
   var text = document.createTextNode("Custom");
   a.appendChild(text);
   li.appendChild(a);
   
}
</script>

The markup for the opening anchor:

<a class="textbutton" href="/include-short.htm" 
onclick="return hs.htmlExpand(this, { objectType: 'ajax' })">
   Click to open
</a>

See the effect:

Click to open

See also

New, Edit