SpanDef
^do( SpanDef, text, tooltip )^
Type: Macro
Purpose: Adds text with tooltip
The SpanDef macro marks text and will show a standard tooltip after the standard delay.
SpanDef is the first of a triple of BoxPress tooltip-type in-line addenda valets. In order of increasing display richness (and decreasing subtleness), these are —
| Macro | Styling | Heading | Links |
|---|---|---|---|
| SpanDef | NO | NO | NO |
| SpanTip | YES | NO | NO |
| SpanPop | YES | YES | YES |
The SpanDef tooltip is perfect for definitions of quasi-technical terms that most readers will not need to look up.
Bonus: A recent study at Duke showed that the best (least distracting) styling to use for tooltip-able text was a “subtle background color difference.” This is probably the effect of our traditional use of highlighting. But the study also noted that the least distracting (measured by reading comprehension score and speed) styling was a “non-fluorescent and non-rectilinear” background effect. SpanDef applies exactly such styling to your links.
I suggest using it for simple definitions rather than footnote-grade excursions. For these, use a more outstanding styling for the link and a display block that can show styles and links.
Note that standard tooltips cannot show text styles. For that purpose, try SpanTip and SpanPop.
Hover below to reveal BoxPress code
<span class="span-def" title="$2" style="cursor:help">$1</span>
SpanDef sample
This is the markup that is rendered below
Here is an ^do(SpanDef, "example", "This is just pain text assigned to the standard HTML ‘title’ attribute.")^ of the SpanDef macro.
Here is an example of the SpanDef macro.