I'm trying to use the affix plugin by twitter bootstrap but I can't figure out how to constrain it within the parent container, i've created the following example to show my problem:
Problem demo: http://www.codeply.com/go/DvcRXkeFZa
<div class="container">
<div class="row">
<div class="col-md-3 column">
<ul id="sidebar" class="well nav nav-stacked" data-spy="affix" data-offset-top="130">
<li><a href="#software"><b>Software</b></a></li>
<li><a href="#features">Features</a></li>
<li><a href="#benefits">Benefits</a></li>
<li><a href="#costs">Costs</a></li>
</ul>
</div>
<div class="col-md-9 column">
<h1>Blah, blah, blah</h1>
<hr>
<a class="anchor3" id="top" name="software"></a>
<p>
content here that scrolls...
</p>
</div>
</div>
</div>
As you can see when you scroll it overflows out of the sidebar, it also doesn't affix to the bottom of the page when it reaches the bottom.
From the Bootstrap docs (http://getbootstrap.com/2.3.2/javascript.html#affix)..
So you need some CSS for
affix
to set the width for the element when it becomes fixed. Such as:Demo on Bootply: http://bootply.com/73864
Related answers on Bootstrap affix:
How to create a sticky left sidebar menu using bootstrap 3?
Twitter-bootstrap 3 affixed sidebar overlapping content when window resized and also footer
In an answer to @FreezeDriedPop I found this to work for me: