# Responsive Height for Hybrid Mobile App

**URL:** <https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947>\
**Category:** Responsiveness\
**Created:** [May 3, 2019, 9:28pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947 "2019-05-03T21:28:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 3, 2019, 9:28pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/1 "2019-05-03T21:28:57Z")

</div>

So I have been stuck on having responsive height for my hybrid mobile App I am creating. My app dimension is the recommended 320wx640h and the issue I am having is obviously 640 as a height is too long for some phone screens and to short for others. I have looked into the html/ javascript trick but it doesn’t work for elements that aren’t a Group or Floating Group. I have attached a screenshot of what I am dealing with below.  
Thanks for the help in advance.

 ![Screenshot_20190502-114136_FileUp](https://us1.discourse-cdn.com/bubble/original/3X/a/6/a678e32e47700d02bee49c2f720e56daed4d2c0c.jpeg)

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [May 3, 2019, 10:51pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/2 "2019-05-03T22:51:30Z")

</div>

Wrap it inside a floating group and the floating group inside another group. Attach it to Top and Bottom. Will have responsive height. Don’t forget to check responsiveness for each box layer.

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 3, 2019, 10:54pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/3 "2019-05-03T22:54:40Z")

</div>

Wow thank you I have not seen a solution like this yet. I’m excited to try it but I have a few questions. Do I need to put any html codes.Also when you say wrap it inside a floating group. Wrap the Map inside a floating group and then wrap both of those inside of another floating group or just a regular group? Sorry I am relatively new to bubble. Thanks for the support though! @nocodeventure

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [May 3, 2019, 11:25pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/4 "2019-05-03T23:25:01Z")

</div>

A floating group has responsive height. When you place it inside a group you can set it to be fixed to the top and bottom. If you don’t place it inside a group it will attach to top and bottom of the entire page.

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 3, 2019, 11:53pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/5 "2019-05-03T23:53:31Z")

</div>

I am sorry for how non-technical I am but when you say attach the floating group to the top and bottom, do you mean both? also the floating group itself is responsive but the map that I attached to the floating group it not responsive. @nocodeventure

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 4, 2019, 2:58am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/6 "2019-05-04T02:58:23Z")

</div>

Floating Group Elements cannot live inside other Elements – you can only have them live on the page, but you can “anchor” them to an Element above it, below it, or both.

Here’s an example showing the “Vertically float relative to” set to ‘Both’.

![image](https://us1.discourse-cdn.com/bubble/original/3X/0/a/0a23ae68ade48d21257715f60a5a5a735f7199fa.png)

The black colored side menu in the video below is a floating group that is anchored to the top and bottom of the page.

[![](https://img.youtube.com/vi/fcGGbQenCfk/maxresdefault.jpg "May 3, 2019 10:46 PM") ](https://www.youtube.com/watch?v=fcGGbQenCfk)

To make the “Settings” icon float I’m actually using CSS to float it (it’s a Group Element) within the Floating Group. This is accomplished by giving the Group Element an ID attribute, then adding some CSS using an On Page Load step in the Workflow page.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/6/76bebc86abed553d150cd52f6d1c2d0596b13461.png)

![image](https://us1.discourse-cdn.com/bubble/original/3X/4/d/4d048c5b33ef6b38fd4e0cf3abba4068d34f2461.png)

To add CSS in workflow, you need to install the CSS Tools plugin, then add a “CSS Tool” element to your page". This is really only added so you can add the workflow action to add custom CSS.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/a/dac8e66400fed4bdc600fd395c61c99e1edc0dc6.png)

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 3:04am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/7 "2019-05-04T03:04:37Z")

</div>

Wow this cleared up a lot of things I actually just fell into CSSTools. I understand a lot of this but my main issue is do I just copy what your put into your ‘Add Custom Style to Head CSSTools B’ and switch #settings to example my map whose ID is map? Would that then make my map responsive if it is within a floating group? @Kfawcett  
btw I am very thankful for your response!!

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 4, 2019, 3:17am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/8 "2019-05-04T03:17:41Z")

</div>

A point of clarification, “responsive” typically applies to width, and what elements show at different widths through “breakpoints”.

Most websites typically use percentages for height, but Bubble does not allow us to set percentages for elements, only pixels, which makes some fairly simple designs more complicated to achieve in Bubble.

See this post for more details if you’re interested in history.

> [@Setting a group to be % of viewport height dynamically](http://forum.bubble.io/t/setting-a-group-to-be-of-viewport-height-dynamically/12700/49):
>
> @raf970 This question/comment has been raised many times over the last couple of years, but the Bubble team doesn’t think it’s necessary. They have given us the “Floating Group” element, but using it comes with its own set of challenges. I too would LOVE the ability to specify height and width percentages on the Group elements. The height would need to be relative to the parent container/group though (like divs within divs).

So, your options to make something “height flexible” is to use the Floating Group element with “Vertically float relative to” set to ‘Both’ or use javascript in workflow to resize the element(s).

Futher reading: this post discusses how to dynamically change an elements height/width through javascript.

> [@Make a GroupFocus scrollable / dynamically adjust a GroupFocus height?](http://forum.bubble.io/t/make-a-groupfocus-scrollable-dynamically-adjust-a-groupfocus-height/44615/7):
>
> @Lucien, my use case is slightly different, so you’ll need to tweak the javascript to your needs by getting the various heights of elements and calculating whether to enable the scroll or not. That being said the general steps will allow you to use a Group Focus and add a scroll bar to it. Like @Bubbleboy mentioned about other content impacting, you’ll notice in the section above the highlighted text I’m getting the height of my header and subtracting that from the height of the window to ensur…

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 3:26am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/9 "2019-05-04T03:26:46Z")

</div>

I am sorry maybe I am not relaying what my issue is. I understand that the floating group element dynamically changes height/width my issue is I have a map within my app that does not a responsive height. Even though I put it within a floating group and set it to vertically float to both. Also I looked at the link you proved for the groupfocus scrollable. Again I am not technical at all. But how can I use that for my cap of simply making the height of my map dynamic to the screen that is fitting it? Is there a way maybe to figure out the screens height in pixels and then apply is using CSS change element size?  
Thank you again for your help!

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 4, 2019, 3:37am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/10 "2019-05-04T03:37:56Z")

</div>

If you share your app with us, or provide screenshots, it may help us help you.

How are you adding a map? Is it in an HTML element or a plugin?

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 3:44am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/11 "2019-05-04T03:44:17Z")

</div>

So The second screenshot says alot of my problem. The map is 320x640. I have a Galaxy s9+ which has a pixel height that is longer then 640. But the grey color you see below is the floating group that I attached the map inside of. The floating group seems to know the height of my screen but the map does not. I am just having a hard time getting this concept down. I am adding the map as a plugin I believe. It the google maps that bubble provides I believe.

 ![Screenshot_20190502-114136_FileUp](https://us1.discourse-cdn.com/bubble/original/3X/a/6/a678e32e47700d02bee49c2f720e56daed4d2c0c.jpeg) ![Screenshot_20190503-223924_FileUp](https://us1.discourse-cdn.com/bubble/original/3X/3/0/3089a531ea049f7004064532aceb8012075841a3.jpeg)

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 3:58am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/12 "2019-05-04T03:58:41Z")

</div>

Update…I got it! Wow you this code of Run js on page load worked!  
Thank you @Kfawcett and @nocodeventure!!  
now I just have to figure out how to make it fit in-between my header and footer! as in this picture. I am more than thankful this has been about 2 weeks or searching for an answer and I finally got it thanks to y’all!!

 ![Screenshot_20190502-114136_FileUp](https://us1.discourse-cdn.com/bubble/original/3X/a/6/a678e32e47700d02bee49c2f720e56daed4d2c0c.jpeg)  
function resize() {  
var h = window.innerHeight;  
var navHeight = h + ‘px’;  
$(‘#left-nav’).css({‘height’:navHeight, ‘overflow-y’:‘auto’});  
}

resize();

$(window).resize(function() {  
resize();  
});

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 4, 2019, 4:16am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/13 "2019-05-04T04:16:22Z")

</div>

Take a look at the stuff around “top of target” in this code, and the posts below it. Basically you need to account for the height of your header, and possibly footer too.

> [@Make a GroupFocus scrollable / dynamically adjust a GroupFocus height?](http://forum.bubble.io/t/make-a-groupfocus-scrollable-dynamically-adjust-a-groupfocus-height/44615/11):
>
> I haven’t tested this, but was trying to think through all of the values you would need. I would trigger it in workflow “when the GF is visible”. function resize() { // the current height of the window var h = window.innerHeight; // the object to update var target = $('#gf-users'); // the position of the top of the target obejct var topOfTarget = target.position().top // the full height of the target object var targetHeight = target.outerHeight; // the height between the top of the target …

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 4:24am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/14 "2019-05-04T04:24:14Z")

</div>

Hmm thank you for this. But again I have no technical background is JS. Do I simply switch the top in topOfTarger = target.position().-\>top\<- to my pixel length? For example my header and footer are both 60pixels in height and this will be the basis of my app so I will be able to copy this to all my elements. What would the code look like?

UPDATE!  
I just had to change the line  
var navHeight = h - 120; before ‘120’ was ‘px’ so I then changed it to my required height!

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [May 4, 2019, 10:30am UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/15 "2019-05-04T10:30:06Z")

</div>

> [@realpurpleshift](#):
>
> function resize() {  
> var h = window.innerHeight;  
> var navHeight = h + ‘px’;  
> $(’#left-nav’).css({‘height’:navHeight, ‘overflow-y’:‘auto’});  
> }
> 
> resize();
> 
> $(window).resize(function() {  
> resize();  
> });

Did you attach this code to the the map?

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 4, 2019, 11:29pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/16 "2019-05-04T23:29:26Z")

</div>

Yes I did.

---

<div class="post-metadata">

**Author:** ![jamesbond](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jamesbond/32/40242_2.png) [@jamesbond](https://forum.bubble.io/u/jamesbond)\
**Post date:** [May 15, 2019, 12:13pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/17 "2019-05-15T12:13:12Z")

</div>

Nice work @Kfawcett! I was wondering how you managed to only show the scrollbar when a group in your RG is hovered? I’ve figured out how to do it when the actual position of the scrollbar is hovered but not when a group is. Any idea?

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 15, 2019, 4:01pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/18 "2019-05-15T16:01:37Z")

</div>

I’m setting an ID attribute on the Floating Groups, then using a “When page is loaded” step to add some CSS.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/9/e96ad0b19fc8213ea1e9d2f25ae15fdfbb04e30a.png)

```
#fg-navigation, #fg-preview, #fg-view, #gf-view-email
{
 overflow-x: hidden;
 overflow-y: hidden !important;
}
#gf-view-email:hover, #fg-navigation:hover, #fg-preview:hover, #fg-view:hover
{
 overflow-x: hidden;
 overflow-y: auto !important;
}
#fg-navigation::-webkit-scrollbar-thumb, #fg-preview::-webkit-scrollbar-thumb, #fg-view::-webkit-scrollbar-thumb, #gf-view-email::-webkit-scrollbar-thumb 
{
 background: #bdbdbd;
}
#fg-navigation::-webkit-scrollbar, #fg-preview::-webkit-scrollbar, #fg-view::-webkit-scrollbar, #gf-view-email::-webkit-scrollbar
{
width: 8px;
}
#fg-navigation::-webkit-scrollbar-button, #fg-preview::-webkit-scrollbar-button, #fg-view::-webkit-scrollbar-button, #gf-view-email::-webkit-scrollbar-button
{
  height: 10px;
}

```

---

<div class="post-metadata">

**Author:** ![jamesbond](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jamesbond/32/40242_2.png) [@jamesbond](https://forum.bubble.io/u/jamesbond)\
**Post date:** [May 15, 2019, 4:24pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/19 "2019-05-15T16:24:52Z")

</div>

#Lifesaver

---

<div class="post-metadata">

**Author:** ![realpurpleshift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/realpurpleshift/32/40219_2.png) [@realpurpleshift](https://forum.bubble.io/u/realpurpleshift)\
**Post date:** [May 15, 2019, 4:55pm UTC](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947/20 "2019-05-15T16:55:30Z")

</div>

@kfawcett Hello again, unfortunately I’ve ran into another responsive height issue.

So lets say I have responsively set my map but I then have a element within my map for example a text box. how do I get the text box to have responsive height as well. How do I make the text box relative to the map.  
In the editor I actually placed the text box on the bottom of my screen but when I look at it on my phone it does not actually go to the bottom of the screen thus not responsive.

Thanks again for the help!

 ![Screenshot_20190515-115200_FileUp](https://us1.discourse-cdn.com/bubble/original/3X/f/8/f8ab9ba13e4517dadde579adda44b264a8c477cd.jpeg)

[Next page](https://forum.bubble.io/t/responsive-height-for-hybrid-mobile-app/55947.md?page=2)
