我一直在尝试围绕 Javascript 进行思考,一直在寻找一种方法将其变成一个仅影响当前悬停的 DOM 元素(我也通过 createElement 使用 javascript 创建)的函数。我尝试了 .target 和 currentTarget 的东西,没有用。如果有人能尽可能多地为我指明正确的方向,我将永远感激不尽!
/* This first function is the experimental one, I tried this but to no avail */
function displayTooltip1(tt) {
var x = tt.currentTarget;
x.style.cssText = "width: 100px; height: 100px; display: inline-block; margin: 0;1.5px 0 1.5px; overflow: visible;"
}
function displayTooltip2() {
document.getElementById('image2').style.cssText = "width: 100px; height: 100px; display: inline-block; margin: 0 1.5px 0 1.5px; overflow: visible;";
}
function displayTooltip3() {
document.getElementById('image3').style.cssText = "width: 100px; height: 100px; display: inline-block; margin: 0 1.5px 0 1.5px; overflow: visible;";
}