Fix layout when having scrolled down
This commit is contained in:
parent
101473dccc
commit
5a7553f902
@ -7,7 +7,7 @@ export class Tooltip {
|
|||||||
document.body.addEventListener("mousemove", (event: MouseEvent) => {
|
document.body.addEventListener("mousemove", (event: MouseEvent) => {
|
||||||
this.element.style.opacity = "1";
|
this.element.style.opacity = "1";
|
||||||
this.element.style.left = event.x + OFFSET + "px";
|
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);
|
if (this.timeout) clearTimeout(this.timeout);
|
||||||
this.timeout = setTimeout(() => {
|
this.timeout = setTimeout(() => {
|
||||||
|
@ -114,7 +114,7 @@ function displayZipCode(
|
|||||||
boundaryElem.style.left = bottomleft.x + rect.left + "px";
|
boundaryElem.style.left = bottomleft.x + rect.left + "px";
|
||||||
boundaryElem.style.top = topright.y + rect.top + document.documentElement.scrollTop + "px";
|
boundaryElem.style.top = topright.y + rect.top + document.documentElement.scrollTop + "px";
|
||||||
boundaryElem.style.width = topright.x - bottomleft.x + "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(
|
function setupMap(
|
||||||
|
@ -199,7 +199,7 @@ code {
|
|||||||
|
|
||||||
#tooltip {
|
#tooltip {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
color: black;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
Loading…
Reference in New Issue
Block a user