Fix layout when having scrolled down

This commit is contained in:
ReiMerc 2023-02-10 09:14:36 +01:00
parent 101473dccc
commit 5a7553f902
3 changed files with 3 additions and 3 deletions

View File

@ -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(() => {

View File

@ -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(

View File

@ -199,7 +199,7 @@ code {
#tooltip {
display: none;
position: fixed;
position: absolute;
background-color: white;
color: black;
padding: 5px;