-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.js
37 lines (34 loc) · 1.26 KB
/
map.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function svgturkiyeharitasi() {
const element = document.querySelector("#svg-turkiye-haritasi");
const info = document.querySelector(".il-isimleri");
element.addEventListener("mouseover", function (event) {
if (
event.target.tagName === "path" &&
event.target.parentNode.id !== "guney-kibris"
) {
info.innerHTML = [
"<div style='border-radius: 10px;box-shadow: 10px 10px 10px -10px #fff;'>",
'<span style="font-weight:bold;border-bottom:1px solid #00ffff;padding-bottom:2px;color:#fb667a">',
event.target.parentNode.getAttribute("data-iladi"),
"</span>",
"<li>",
"<br>",
"<span style='font-weight:bold;color:#4dc3fa'>",
" 2.Doz Yüzdesi: ",
"</span>",
"<span style='font-weight:bold'>",
document.querySelector('[data-iladi='+event.target.parentNode.getAttribute("data-iladi")+'] > span').innerHTML,
"</span>",
"</li>",
"</div>",
].join("");
}
});
element.addEventListener("mousemove", function (event) {
info.style.top = event.pageY + 25 + "px";
info.style.left = event.pageX + "px";
});
element.addEventListener("mouseout", function (event) {
info.innerHTML = "";
});
}