diff --git a/service2.js b/service2.js index 0914204..e51c13a 100644 --- a/service2.js +++ b/service2.js @@ -1475,7 +1475,7 @@ class BesPopup extends HTMLElement { } else if (this.offsetWidth <= x) { this.style.left = `${x - this.offsetWidth}px` } else { - this.style.left = `${x - this.offsetWidth / 2}px` + this.style.left = `${(window.innerWidth - this.offsetWidth) / 2}px` } if (y + 20 + this.offsetHeight <= window.innerHeight) { @@ -1483,7 +1483,7 @@ class BesPopup extends HTMLElement { } else if (this.offsetHeight <= y) { this.style.top = `${y - this.offsetHeight}px` } else { - this.style.top = `${y - this.offsetHeight / 2}px` + this.style.top = `${(window.innerHeight - this.offsetHeight) / 2}px` } }