From f2c6bb201403aa287429c38324deeeddbab4b3b6 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Wed, 4 Mar 2020 20:46:57 +0900 Subject: [PATCH] get width and height from boundign client rect --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5e652a2..e635f39 100644 --- a/index.js +++ b/index.js @@ -12,9 +12,10 @@ function getSize(el) { } } + var boundingRect = el.getBoundingClientRect(); return { - width: el.offsetWidth, - height: el.offsetHeight + width: boundingRect.width, + height: boundingRect.height, } }