Object: hsVariables
Functions
EventsObject: hs.ExpanderVariablesFunctionsEvents
|
hs.registerOverlayApply custom overlays to image or HTML expanders.
void hs.registerOverlay(Object options)
Highslide has two easily accessable overlays, namely the heading and the caption. If you want to add overlays other than these, you use hs.registerOverlay. See Custom overlays in the documentation for full explanation. When you want to add individual overlays for each expander, hs.Expander.prototype.createOverlay is generally a better option. Or you can use the hs.Expander.prototype.onCreateOverlay event to change the properties of the overlay before it is added to each single expander.
Details
Parameters
ExamplePutting some text in an overlayPlease note that in most cases, using a heading or caption is better for this effect. 1. In a script tag in the head section of your page, call the hs.registerOverlay function. In this case thumbnailId is set to null, as we want the overlay to tie to all expanders. hs.registerOverlay({ thumbnailId: null, overlayId: 'my-overlay', position: 'top left', hideOnMouseOut: true, opacity: 0.8 }); 2. A div containing your overlay, with an id corresponding to the overlayId above, is created somewhere in the body of your HTML page. Styles can be set inline or using CSS rules. <div class="highslide-overlay" id="my-overlay" style="background: black; font-weight: bold; font-size: 150%; color: white; margin-top: 2em; padding: 1em"> This is some text in an overlay </div> 3. A CSS rule telling the overlay to be initially hidden. .highslide-overlay { display: none; } 4. The normal expander markup. <a class="highslide" href="../samples/full3.jpg" onclick="return hs.expand(this)"> <img src="../samples/thumb3.jpg" alt=""/> </a> This is the effect of the above: See also |