当屏幕小于768px
时,会出现引导程序侧面板。我的面板非常快,我想让它慢慢显示。你能否给我一些关于jquery
代码中缺失部分的提示?
HTML标记:
<div class="row row-offcanvas row-offcanvas-left">
<!-- sidebar -->
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>
</div>
<!-- main area -->
<div class="col-xs-12 col-sm-9">
<h1>Shrink Width to Collapse Sidebar</h1>
</div></div>
jQuery代码:
$(document).ready(function() {
$('[data-toggle=offcanvas]').click(function() {
$('.row-offcanvas').toggleClass('active');
});
});