##### 16.9.8.2 Creating drop-down hotspots with DITA2Go macros only

The following settings use three macros to handle open/close actions for dedicated drop-down paragraph format DropPara.

[HTMLParaStyles]
DropPara = CodeBefore CodeStart CodeAfter

[ParaStyleCodeBefore]
; At the start of any of the following paragraphs,
; close any open drop-down blocks:
DropPara = <$DropDownBlockClose>
; List any other paragraphs that should end a drop-down block:
H1 = <$DropDownBlockClose>
H2 = <$dropdownblockclose>
H3 = <$DropDownBlockClose>
H4 = <$DropDownBlockClose>
H5 = <$DropDownBlockClose>

[ParaStyleCodeStart]
; Before the DropPara text, insert a drop-down link:
DropPara = <$DropDownLinkOpen>
[ParaStyleCodeAfter]
DropPara = <$DropDownBlockOpen>

[Inserts]
; At end of body, close any open drop-down blocks:
Bottom = <$DropDownBlockClose>
[DropDownLinkOpen]
; Before DropPara text, set a new drop-down link:
<$$DropDownCount++>
<a class="dropdown"
href="javascript:doSection('drop<$$DropDownCount>');void 0;">
<img src="dropopen.gif" id="iodrop<$$DropDownCount>"
style="border:0;" alt="Click to open.">
<img src="dropclose.gif" id="icdrop<$$DropDownCount>"
style="display:none;border:0;" alt="Click to close.">
[DropDownBlockOpen]
; After DropPara, insert javascript to open a new drop-down block,
; and set a flag to signify that the block is open. The javascript
; includes a counter to identify the drop-down section:
<div class="dropdown" id="drop<$$DropDownCount>" style="display:none;"
onclick="noSection('drop<$$DropDownCount>')">
<$$Flag_DropDownBlockOpen = 1>

[DropDownBlockClose]
; Before DropPara or H1 through H5 or </body>,
; check a flag to see if a drop-down block is open;
; if so, close the drop-down block and clear the flag:
<$_if ($$Flag_DropDownBlockOpen)>
</div>
<$$Flag_DropDownBlockOpen = 0>
<$DropDownLinkOpen>
<$_endif>

[MacroVariables]
; Put any macro definition sections before this section.
Flag_DropDownBlockOpen = 0
DropDownCount = 0

Previous Topic: 16.9.8.1 Creating drop-down hotspots with DITA2Go controls and macros

Next Topic: 16.10 Setting up Context Sensitive Help (CSH)

Parent Topic: 16.9.8 Emulating Web Works Publisher drop-down hotspots

Sibling Topics:

16.9.8.1 Creating drop-down hotspots with DITA2Go controls and macros

Table of Contents • Index