diff --git a/app/static/js/highlight.js b/app/static/js/highlight.js index d2c37a8..c239eaa 100644 --- a/app/static/js/highlight.js +++ b/app/static/js/highlight.js @@ -114,12 +114,12 @@ function showWordMeaning(event) { return; } - - tooltip.textContent = data.translation || '没有找到该单词的中文意思'; tooltip.style.left = `${tooltipX}px`; tooltip.style.top = `${tooltipY}px`; tooltip.style.display = 'block'; + tooltip.style.position = 'absolute'; + tooltip.style.background = 'yellow'; // 可以在这里添加点击事件监听器来隐藏tooltip,但注意避免内存泄漏 document.addEventListener('click', function handler(e) { @@ -141,4 +141,4 @@ function addClickEventToHighlightedWords() { }); } -showBtnHandler(); \ No newline at end of file +showBtnHandler(); diff --git a/app/templates/userpage_get.html b/app/templates/userpage_get.html index 8daa344..60598df 100644 --- a/app/templates/userpage_get.html +++ b/app/templates/userpage_get.html @@ -107,6 +107,7 @@