6
Hello, I’d like to do the following.
<div class="pai">
<div class="form"></div>
<div class="text"></div>
</div>
I have a div FATHER And inside of it are two divs on each other’s side.
The height of the div FORM depends on the amount of content that may vary.
The height of the div TEXT is fixed.
I want when I div it FORM is bigger than the div TEXT, the div TEXT stay Fixed rolling along the page, but with a limit of scrolling until the end of the div FORM.
Just as in the picture if the div FORM is bigger than the div TEXT and the page is rolled, the div TEXT will roll along until it reaches the end of the div FORM.
It’s like a navbar-Fixed-top, but it won’t roll the whole site, but it will roll until it’s aligned with the div FORM, by aligning with the div FORM.
If it’s rolled up again, the div TEXT will roll until you reach the top of the div FORM.
In short, always using FORM as a reference for the div TEXT that will only be Fixed in case the div FORM be greater.
Remembering that I am using bootstrap, I almost got it with affix, but when it aligns with the base of div FORM instead of remaining static aligned to base, it returns to its original position.
Almost, but the div TEXT is absolute, so if there is more content below the div FATHER, the div TEXT keeps descending. I want even if it has more content below the div FATHER, the div TEXT stop scrolling as soon as she reaches the end of the div FATHER. And if the user scrolls to the top to div TEXT scroll to the top of the div FATHER. Any doubt just call.
– Giovani Rodrigo