I am trying to use Bootstrap off canavas left side bar to toggle on small devices.
here is the bootply code example:
www.bootply.com/C2wQEkdSAn
The problem when displaying on mobile when you click on the accordion the contents are
not pushing the footer down but hides behind it.
Here is the full code:
<!doctype html> <html lang="en"> <head>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<style> /*a * Style tweaks *
-------------------------------------------------- */ body { padding-top: 70px; } footer { padding-left: 15px; padding-right: 15px; }
/* * Off Canvas * --------------------------------------------------
*/ @media screen and (max-width: 768px) { .row-offcanvas {
position: relative;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
transition: all 0.25s ease-out; }
.row-offcanvas-left .sidebar-offcanvas {
left: -50%; }
.row-offcanvas-left.active {
left: 50%; }
.sidebar-offcanvas {
position: absolute;
top: 0;
width: 50%;
margin-left: 12px; } } </style>
</head> <body> <div class="navbar navbar-fixed-top navbar-inverse" role="navigation"> <div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!-- /.nav-collapse --> </div><!-- /.container --> </div><!-- /.navbar -->
<div class="container">
<div class="row row-offcanvas row-offcanvas-left">
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
<p class="visible-xs">
<button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas"><i class="glyphicon glyphicon-chevron-left"></i></button>
</p>
<div class="well sidebar-nav">
<ul class="nav">
<li>Sidebar</li>
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li>Sidebar</li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li>Sidebar</li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
Sidebar text...<br>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…