From dcebe336281d068649927a8bb8d3c0403807ef01 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 22 Aug 2017 21:55:16 +0900 Subject: [PATCH] add scroll to hint position --- src/content/hint.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/content/hint.js b/src/content/hint.js index f59899d..fabf725 100644 --- a/src/content/hint.js +++ b/src/content/hint.js @@ -10,12 +10,14 @@ export default class Hint { let doc = target.ownerDocument let { top, left } = target.getBoundingClientRect(); + let scrollX = window.scrollX; + let scrollY = window.scrollY; this.element = doc.createElement('span'); this.element.className = 'vimvixen-hint'; this.element.textContent = tag; - this.element.style.top = top + 'px'; - this.element.style.left = left + 'px'; + this.element.style.left = left + scrollX + 'px'; + this.element.style.top = top + scrollY + 'px'; this.show(); doc.body.append(this.element);