Bootstrap手机端弹出隐藏的侧栏菜单

来源:https://www.sucaihuo.com/js/643.html 2016-01-04 19:50浏览(5977) 收藏

bootstrap.offcanvas.js是一款流行的滑动导航菜单插件,只要定义好html,即可生成菜单栏按钮和隐藏的右侧菜单弹出层。
Bootstrap手机端弹出隐藏的侧栏菜单
分类:导航菜单 > 展开收缩 难易:高级
查看演示 下载资源 下载积分: 20 积分

点击按钮

<button type="button" class="navbar-toggle offcanvas-toggle" data-toggle="offcanvas" data-target="#js-bootstrap-offcanvas">
</button>

隐藏的弹出层菜单结构

<nav class="navbar navbar-default navbar-offcanvas navbar-offcanvas-right navbar-offcanvas-touch navbar-offcanvas-fade" role="navigation" id="js-bootstrap-offcanvas-2">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">Brand 2</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle">Another Link <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left" role="search">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Link</a></li>
                <li><a href="#">Another Link</a></li>
            </ul>
        </div>
    </div>
</nav>

引入bootstrap.offcanvas.js侧边栏隐藏菜单插件

<link rel="stylesheet" href="css/bootstrap.offcanvas.min.css"/>
<script src="js/bootstrap.offcanvas.js"></script>
标签: bootstrap侧栏
评论2
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

  • 头像 椅子
    10-03 00:22
    我***蒙
    这个效果挺好的啊
  • 头像 沙发
    04-27 15:31
    8***l
    拿来用很好
1 2