Get accurate element dimensions, even if it's hidden!
npm install get-node-dimensions --save
<script src="https://unpkg.com/get-node-dimensions/dist/get-node-dimensions.js"></script>
(UMD library exposed as `getNodeDimensions`)
import getNodeDimensions from 'get-node-dimensions'
const div = document.getElementById('div-to-measure')
console.log(getNodeDimensions(div)) // { width, height, top, right, bottom, left }
Returns element rect which includes width
, height
, top
, right
, bottom
, left
.
createOptions
: