/ Published in: JavaScript

Use ref with getDOMNode() to get the actual html.
Using getBoundingClientRect() on the actual html will give you the width, height, etc.
Below:
specs = ClientRect {} bottom: 269 height: 18 left: 797.546875 right: 1062.609375 top: 251 width: 265.0625__proto__: ClientRect
console.log(specs.bottom) will return 269
Using getBoundingClientRect() on the actual html will give you the width, height, etc.
Below:
specs = ClientRect {} bottom: 269 height: 18 left: 797.546875 right: 1062.609375 top: 251 width: 265.0625__proto__: ClientRect
console.log(specs.bottom) will return 269
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
getCoordinates: function(){ var dropMen = this.refs.targetDiv.getDOMNode(); var specs = dropmen.getBoundingClientRect(); } render: function(){ return <div ref="targetDiv"></div> }
Comments
