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

Determine whether the given element is an unobtrusively marked up Highslide anchor.
string hs.isUnobtrusiveAnchor( DOMElement el )
By default, when Highslide is used in unobtrusive mode, the rel attribute of a HTML anchor is used to mark it up to be processed by Highslide. The rel attribute can be 'highslide' for images, 'highslide-ajax', 'highslide-iframe' or 'highslide-swf'. This is recognized in the hs.isUnobtrusiveAnchor function. By creating your own function instead of this and return 'image', 'ajax', 'iframe' or 'swf', you can make Highslide recognize all kinds of links for processing.

Details

Requires unobtrusive
Type function
Returns string

Parameters

el
The DOM element to inspect.

Example

Make all image links on the page open in Highslide

Make a function that returns 'image' if the link's href points to a .jpg image. Put this code in the head section of your page or in a separate JavaScript file:

hs.isUnobtrusiveAnchor = function(el) {
	if (el.href && /\.jpg$/.test(el.href)) {
		el.className = 'highslide'; // for the zoom-in cursor
		return 'image';
	}
}
Now we try it out on this link:
<a href="../samples/full1.jpg">This is a simple link to an image</a>

The effect: This is a simple link to an image.

See also

New, Edit