Created
January 7, 2024 15:13
-
-
Save ssaurel/c0273f514c4a05b81676538d4075f21b to your computer and use it in GitHub Desktop.
India Map Tooltip on SSaurel's Blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids = ['IN-AN', 'IN-AP', 'IN-AR', 'IN-AS', 'IN-BR', 'IN-CH', 'IN-CT', 'IN-DD', 'IN-DL', 'IN-DN', 'IN-GA', 'IN-GJ', | |
'IN-HP', 'IN-HR', 'IN-JH', 'IN-JK', 'IN-KA', 'IN-KL', 'IN-LD', 'IN-MH', 'IN-ML', 'IN-MN', 'IN-MP', | |
'IN-MZ', 'IN-NL', 'IN-OR', 'IN-PB', 'IN-PY', 'IN-RJ', 'IN-SK', 'IN-TG', 'IN-TN', 'IN-TR', | |
'IN-UP', 'IN-UT', 'IN-WB']; | |
function init(evt) { | |
if ( window.svgDocument == null ) { | |
svgDocument = evt.target.ownerDocument; | |
} | |
tooltip = svgDocument.getElementById('tooltip'); | |
tooltip_bg = svgDocument.getElementById('tooltip_bg'); | |
for (var i in ids) { | |
elt = document.getElementById(ids[i]); | |
elt.onmouseover = function (e) { | |
showTooltip(e, capitalizeFirstLetter(e.currentTarget.getAttribute("title"))); | |
}; | |
elt.onmouseout = function (e) { | |
hideTooltip(e); | |
}; | |
} | |
colourCountries(data1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment