-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtooltip.js
17 lines (17 loc) · 847 Bytes
/
tooltip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function tooltipActived(){
let tooltipEle = document.querySelectorAll(`[data-tooltip]`);
tooltipEle.forEach((element => {
if (typeof tooltip === "undefined") {
element.style.setProperty("--tooltipColor", "#000");
element.style.setProperty("--tooltipBackgroound", "#e8e8e8");
element.style.setProperty("--tooltipBorderRadius", "5px");
element.style.setProperty("--tooltipBoxShadow", "0px 0px 5px #002b");
} else {
element.style.setProperty("--tooltipColor", tooltip.textColor || "#000");
element.style.setProperty("--tooltipBackgroound", tooltip.backgroundColor || "#e8e8e8");
element.style.setProperty("--tooltipBorderRadius", tooltip.borderRadius || "5px");
element.style.setProperty("--tooltipBoxShadow", tooltip.boxShadow || "0px 0px 5px #002b");
}
}))
}
export{tooltipActived}