diff --git a/frontend/src/Tooltip.ts b/frontend/src/Tooltip.ts index 4004a29..1156662 100644 --- a/frontend/src/Tooltip.ts +++ b/frontend/src/Tooltip.ts @@ -7,7 +7,7 @@ export class Tooltip { document.body.addEventListener("mousemove", (event: MouseEvent) => { this.element.style.opacity = "1"; this.element.style.left = event.x + OFFSET + "px"; - this.element.style.top = event.y + OFFSET + "px"; + this.element.style.top = event.y + OFFSET + document.documentElement.scrollTop + "px"; if (this.timeout) clearTimeout(this.timeout); this.timeout = setTimeout(() => { diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 51764f4..a3c4b5a 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -114,7 +114,7 @@ function displayZipCode( boundaryElem.style.left = bottomleft.x + rect.left + "px"; boundaryElem.style.top = topright.y + rect.top + document.documentElement.scrollTop + "px"; boundaryElem.style.width = topright.x - bottomleft.x + "px"; - boundaryElem.style.height = bottomleft.y - topright.y + document.documentElement.scrollTop + "px"; + boundaryElem.style.height = bottomleft.y - topright.y + "px"; } function setupMap( diff --git a/frontend/style.css b/frontend/style.css index b1e2775..97324d8 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -199,7 +199,7 @@ code { #tooltip { display: none; - position: fixed; + position: absolute; background-color: white; color: black; padding: 5px;