hs.stripItemFormatter
Allows specific formatting of each item in a thumbstrip.
string hs.stripItemFormatter ( DOMElement )
By default the thumbstrip items are a copy of the opening anchor's inner HTML. So if you have a thumbnail image wrapped by an a
, the HTML of the thumbnail image will be copied over to the thumbstrip. You can for example use the id of the opening anchor to access one specific anchor.
Details
Requires |
slideshow, thumbstrip |
Type |
function |
Returns |
string |
Parameters
Example
Access a specific thumbnail by id, and change the output
The opening anchor has a text content instead of a thumbnail image:
<a id="thumb1" href="image1.jpg" onclick="return hs.expand(this, { slideshowGroup: 'group1' } )">
Click to view a slideshow
</a>
The text doesn't look good in a thumbstrip, so we'll change this specific thumbstrip item to display a thumbnail instead. Place this code in the head section of your page or in a separate .js file.
hs.stripItemFormatter = function(a) {
if (a.id == 'thumb1') return '<img src="thumb1.jpg" alt="" />';
}
See also