Tooltips for your site
Add one line to any page and every link to the Dominion Database shows a game tooltip on hover, the same way it does here.
<script src="https://db.worldofdominion.net/tooltip.js"></script>
Then link to records as usual:
<a href="https://db.worldofdominion.net/item=19019">Thunderfury</a> <a href="https://db.worldofdominion.net/spell=133">Fireball</a> <a href="https://db.worldofdominion.net/npc=36597">The Lich King</a>
Supported links: item, spell, npc, quest, achievement, object, currency, itemset, zone, faction and title.
Options
Set these before the script loads:
<script>window.dominionTooltips = { colorLinks: true, iconizeLinks: true, renameLinks: false };</script>
- colorLinks colours item links by quality.
- iconizeLinks puts the icon in front of item, spell and achievement links.
- renameLinks replaces the link text with the record's name.
Try it: Hellscream's Cleaver, Mortal Strike, Level 10.
Tooltip data is also available as JSON at /tooltip/<type>/<id>, with CORS enabled.