6
I have a layout Bootstrap with a right sidebar and I need this "turn" (up/down) when doing scroll, but not above the header and footer. just "float" inside the div[role=main]
My layout:
My code:
<header class="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 managed to run the bar with the affix plugin of bootstrap:
$('.budget-summary').affix({
offset: {
top: 0,
bottom: function () {
return (this.bottom = $('footer#page-footer').outerHeight(true));
}
}
});
but now a problem has arisen. The content of the sidebar is dynamic (grows and decreases). which sometimes causes the content of the sidebar not to be shown in full, as exemplified by the following figure:
there’s a way around this?
Miguel, did you solve the problem?
– Sergio
partially...
– Miguel Borges
What is missing?
– Sergio
is in question. when content is increased, it gets cut
– Miguel Borges
Miguel, looking at his Dit, seems to be the case for a new, separate question rather than an issue in this one. Because the problem has now changed, right? The new question does not invalidate the answers you have already received?
– bfavaretto
you are right. open a new http://answall.com/questions/44972/affix-numa-barra-lateral-dynamica
– Miguel Borges
Miguel has now seen your new question. Have you tested the answer I gave? in that answer the code adapts to the height of the sidebar.
– Sergio
yes, I tried, but it had mts bugs, and since bootstrap already brings a plugin for k keria, it is easier to use it. thx
– Miguel Borges