# Setting a group to be % of viewport height dynamically

**URL:** <https://forum.bubble.io/t/setting-a-group-to-be-of-viewport-height-dynamically/12700>\
**Category:** Tips\
**Created:** [April 21, 2017, 12:56am UTC](https://forum.bubble.io/t/setting-a-group-to-be-of-viewport-height-dynamically/12700 "2017-04-21T00:56:16Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![Lucien](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lucien/32/58216_2.png) [@Lucien](https://forum.bubble.io/u/Lucien)\
**Post date:** [May 13, 2018, 7:54am UTC](https://forum.bubble.io/t/setting-a-group-to-be-of-viewport-height-dynamically/12700/28 "2018-05-13T07:54:19Z")

</div>

Hi, @funwtp.

Here is a way to obtain the viewport’s height:

> [@Get viewport Height in pixels using javescript and css](http://forum.bubble.io/t/get-viewport-height-in-pixels-using-javescript-and-css/20562/2):
>
> Add a “Javascript to Bubble” element to your page, from the ToolBox plugin. Give it a suffix in its property, say “h”. Then add a workflow item to run javascript on page load. In this javascript code add your code that gets the viewport height, and return it to the “Javascript to Bubble” element using bubble\_fn\_suffix(var). Here’s an example (I grabbed the viewport height code off some page and have not tested it): var viewportHeight = Math.max(document.documentElement.clientHeight, window.inn…

---

_[View the full topic](https://forum.bubble.io/t/setting-a-group-to-be-of-viewport-height-dynamically/12700)._
