页面添加jQuery和Bootstrap:
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
包括插件的代码:
<script src="dist/jquery.bootstrap-autohidingnavbar.min.js"></script>
调用插件:
$(".navbar-fixed-top").autoHidingNavbar({ });