1.插件介绍
插件使用环境配置:
jQuery v1.3.2+
Bootstrap 3.x
下载链接:bootstrap wizard
2. 导入文件
你的项目需要导入以下文件:
<link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap.min.css" />
<script src="/js/jquery-2.2.4.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
//该文件为插件的主要文件,可从上述源码中获取,至于上面三个文件自行搜索,网上一堆
<script src="/js/jquery.bootstrap.wizard.js"></script>
插件基础使用(参考源码下的examples目录下各种页面)
用例1:
源码:
<div id="rootwizard" class="tabbable tabs-left">
<ul>
<li><a href="#tab1" data-toggle="tab">First</a></li>
<li><a href="#tab2" data-toggle="tab">Second</a></li>
<li><a href="#tab3" data-toggle="tab">Third</a></li>
<li><a href="#tab4" data-toggle="tab">Forth</a></li>
<li><a href="#tab5" data-toggle="tab">Fifth</a></li>
<li><a href="#tab6" data-toggle="tab">Sixth</a></li>
<li><a href="#tab7" data-toggle="tab">Seventh</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="tab1">
1
</div>
<div class="tab-pane" id="tab2">
2
</div>
<div class="tab-pane" id="tab3">
3
</div>
<div class="tab-pane" id="tab4">
4
</div>
<div class="tab-pane" id="tab5">
5
</div>
<div class="tab-pane" id="tab6">
6
</div>
<div class="tab-pane" id="tab7">
7
</div>
<ul class="pager wizard">
<li class="previous first" style="display:none;"><a href="#">First</a></li>
<li class="previous"><a href="#">Previous</a></li>
<li class="next last" style="display:none;"><a href="#">Last</a></li>
<li class="next"><a href="#">Next</a></li>
</ul>
</div>
</div>
<script>
$(document).ready(function() {
$('#rootwizard').bootstrapWizard({'tabClass': 'nav nav-tabs'});
});
</script>
效果图: