# Set width and height dynamically with JavaScript

**URL:** <https://forums.fusetools.com/t/set-width-and-height-dynamically-with-javascript/4467>\
**Category:** Bug Reports\
**Created:** [August 26, 2015, 7:59am UTC](https://forums.fusetools.com/t/set-width-and-height-dynamically-with-javascript/4467 "2015-08-26T07:59:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnus\_Kjelland](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/magnus_kjelland/32/91_2.png) [@Magnus\_Kjelland](https://forums.fusetools.com/u/Magnus_Kjelland)\
**Post date:** [August 26, 2015, 7:59am UTC](https://forums.fusetools.com/t/set-width-and-height-dynamically-with-javascript/4467/1 "2015-08-26T07:59:32Z")

</div>

Is there any way of getting current device width and height in JavaScript, and then use that variable to define Height in a Panel or a Grid?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [August 26, 2015, 8:19am UTC](https://forums.fusetools.com/t/set-width-and-height-dynamically-with-javascript/4467/2 "2015-08-26T08:19:12Z")

</div>

Nope, that would be a bad idea. JS is not meant to control the UI beyond providing data for the UI to databind to.

If you explain your use case we could help find the best way to acheive it 🙂
