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

An expression to be evaluated into the caption text.

By using captionEval you gain direct access into the hs.Expander context, which means you can define the caption to be pulled from the alt attribute of the thumbnail, the title of the thumbnail or whatever property you want. You can also combine these.

A great advantage of using the thumbnail's alt attribute for caption text, is that this is indexed by the search engines and associated with the image.

Examples of using attributes from the thumbnail or opening anchor are:

this.thumb.alt
The alt attribute of the thumbnail img.
this.thumb.title
The title attribute of the thumbnail img.
this.a.title
The title attribute of the opening anchor.

Details

Requires overlays
Type string
Default value null
Overrideable inline Yes

Example

Pulling the caption from the thumbnail's alt attribute

Put this in the head section of your page. This affects all expanders on your page.

<script type="text/javascript">
   hs.captionEval = 'this.thumb.alt';
</script>

Apply a meaningful alt attribute to your thumbnail image.

<a class="highslide" href="../samples/full3.jpg" 
      onclick="return hs.expand(this)">
   <img src="../samples/thumb3.jpg" 
         alt="This is the alt attribute for the image"/>
</a>

The effect:

This is the alt attribute for the image

See also

New, Edit