Bootstrap Collapsible Right Sidebar

Using the Bootstrap grid system, some CSS and a little jQuery to create a collapsible sidebar.

#content .col-md-9 .col-md-12

Changes from .col-md-9 to .col-md-12 when the sidebar is collapsed, occupying the remaining space.

#row-main {
  /* necessary to hide collapsed sidebar */
  overflow-x: hidden;

#content {
  /* for the animation */
  transition: width 0.3s ease;
/* to toggle the sidebar, just switch the CSS classes */
$("#content").toggleClass("col-md-12 col-md-9");