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

An alternative way to define the URL of the image or HTML content.

The default way to define the URL is through the href attribute of the opening a. However, you may want to create a html page to show if the script fails in old browsers or if the user has disabled JavaScript. This is a good idea for database powered sites, where you can display the caption text in the fallback page. To achieve this you supply the function call of the onclick-attribute with a second parameter where you specify a src.

The hs.src parameter is also the best way to specify the URL when you open the expander from an input button or other HTML elements.

Details

Type string
Default value undefined
Overrideable inline Yes

Example

Providing a richer fallback page

This example requires that you have some kind of dynamic page that can show your image. Mark up your thumbnail like this:

<a href="../showimage.php?src=samples/full5.jpg" class="highslide" 
		onclick="return hs.expand(this, { src: '../samples/full5.jpg' })">
	<img style="margin-top: 10px" width="120" height="102"
	        src="../samples/thumb5.jpg" alt="Highslide JS" 
		title="Click to enlarge" />
</a>

To see how the fallback page looks, control-click the thumbnail to open it in a new tab (FF) or rightclick and open in new tab (IE7), or disable JavaScript in your browser.

Highslide JS
New, Edit