# Dynamic Height in ion-scroll

**URL:** <https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574>\
**Category:** ionic-v1\
**Created:** [May 31, 2015, 9:09pm UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574 "2015-05-31T21:09:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielmm1997](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danielmm1997/32/85966_2.png) [@danielmm1997](https://forum.ionicframework.com/u/danielmm1997)\
**Post date:** [May 31, 2015, 9:09pm UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574/1 "2015-05-31T21:09:51Z")

</div>

Hi all,

i have a problem with the Ionic Scroll. When i have content before the ion-scroll the content in the ion-scroll scrolls back to the start if i scrolling.  
//added on 06.01.2015  
Here the Codepen Example:

> **[Custom Loading Bar: Nightly](https://codepen.io/anon/pen/wagRdq)**
>
> Example of custom Ionic loading indicator styled as a header bar. Forked from \[Ionic\](http://codepen.io/ionic/)'s Pen \[Custom Loading Bar: Nightly\](ht...

and a simple other question  
is it possible to add content before the tabs content?

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![danielmm1997](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danielmm1997/32/85966_2.png) [@danielmm1997](https://forum.ionicframework.com/u/danielmm1997)\
**Post date:** [June 2, 2015, 6:49pm UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574/2 "2015-06-02T18:49:49Z")

</div>

Any Idea?  
I testet much other stuff but can’t fix it

---

<div class="post-metadata">

**Author:** ![bokboki2002](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bokboki2002/32/12515_2.png) [@bokboki2002](https://forum.ionicframework.com/u/bokboki2002)\
**Post date:** [June 2, 2015, 9:01pm UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574/3 "2015-06-02T21:01:51Z")

</div>

How about this:

> **[Custom Dynamic Height Header](https://codepen.io/bokboki2002/pen/QbpGwZ)**
>
> Example of custom dynamic height header. Can be used as a placeholder for video player....

---

<div class="post-metadata">

**Author:** ![danielmm1997](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danielmm1997/32/85966_2.png) [@danielmm1997](https://forum.ionicframework.com/u/danielmm1997)\
**Post date:** [June 4, 2015, 12:05am UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574/4 "2015-06-04T00:05:30Z")

</div>

Thanks for your help but i had a problem with this. the Grey box is a video on my ionic project and the width is 100% so the height is on every device not the same like here [http://codepen.io/anon/pen/bdqMqW](http://codepen.io/anon/pen/bdqMqW)  
So Ionic(AngularJS) must detect the height of the video and put it to the ion-content. Is that possible?

have you a fix for that?

---

<div class="post-metadata">

**Author:** ![bokboki2002](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bokboki2002/32/12515_2.png) [@bokboki2002](https://forum.ionicframework.com/u/bokboki2002)\
**Post date:** [June 4, 2015, 10:15am UTC](https://forum.ionicframework.com/t/dynamic-height-in-ion-scroll/25574/5 "2015-06-04T10:15:42Z")

</div>

Yes, this is possible, using directive.  
I’ve modified an example at: [http://codepen.io/bokboki2002/pen/QbpGwZ](http://codepen.io/bokboki2002/pen/QbpGwZ) so you can take a look.  
When you change the height of video gray box, ion-content with class autoHeightHeader will change top style.
