I have a layout Bootstrap with a sidebar on the right and I need it to "rotate" (up / down) when doing scroll , but not on top of the header and footer. that just "floats" within div[role=main]
My layout:
Mycode:
<headerclass="container">
<div class="row">
<div class="col-sm-12">Header</div>
</div>
</header>
<div role="main" class="container">
<div class="row">
<div class="col-sm-8 col-lg-9">
Main Content
</div>
<aside class="col-sm-4 col-lg-3">
<section class="budget-summary">
<h2 class="text-center">Resumo</h2>
</section>
</aside>
</div>
</div>
<footer>
<div class="row">
<div class="col-sm-12">Footer</div>
</div>
</footer>
EDIT:
I got the bar to run with the bootstrap affix plugin:
$('.budget-summary').affix({
offset: {
top: 0,
bottom: function () {
return (this.bottom = $('footer#page-footer').outerHeight(true));
}
}
});
However, a problem has now arisen. The contents of the sidebar are dynamic (grows and shrinks). which sometimes causes the contents of the sidebar not to be shown in full, as the following figure shows:
Is there a way around this?