Bootstrap - Column with position fixed.

by Kyle Mitofsky

HTML

<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
<div class="container">
    <div class="row">
        <div class="col-xs-8 content">Content</div> 
        <div class="col-xs-3 col-xs-offset-1" id="sidebar-outer" >
            <div id="sidebar">
                <img class="img-responsive" src="http://placekitten.com/300/200"/>
                Some links go here.
            </div>
        </div>
    </div>
</div>




<!-- Post Info -->
<div style='position:fixed;bottom:0;left:0;    
            background:lightgray;width:100%;'>
    About this SO Question: <a href='http://stackoverflow.com/q/23616847/1366033'>Adding a responsive image to a position fixed div within a Bootstrap column</a><br/>
    Fork This Skeleton Here <a href='http://jsfiddle.net/KyleMit/kcpma/'>Bootrsap 3.0 Skeleton</a><br/>
<div>

CSS

.container {
    background-color: #f2f2f2;
}
.content {
    margin-top: 150px;
    background-color: #a9a8a8;
    min-height: 5500px;
}
#sidebar-outer {
    margin-top: 150px;
    position: relative;
}
#sidebar {
   position: fixed;
   width: 25%;
}
@media (min-width: 768px) {
  #sidebar {
    width: 158px; /* 632 * .25 */
  }
}
@media (min-width: 992px) {
  #sidebar {
    width: 213px; /* 852 * .25 */
  }
}
@media (min-width: 1200px) {
  #sidebar {
    width: 263px; /* 1052 * .25 */
  }
}

JavaScript

$(function() {
    $(window).resize(function() {
        $('#width-placeholder').html($("#sidebar").width());
    }).resize();
});