bootstrap:选项卡功能DEMO

html 复制代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>选项卡</title>
<link rel="stylesheet" type="text/css" href="/cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css"  />
</head>
<body>
<ul id="myTab" class="nav nav-tabs">
	<li class="active"><a href="#section1">Section1</a></li>
	<li ><a href="#section2">Section2</a></li>
	<li ><a href="#section3">Section3</a></li>
</ul>
<div class="tab-content">
	<div id="section1" class="tab-pane in active">
		<h2>section1</h2>
		<p>...</p>
	</div>
	<div id="section2" class="tab-pane">
		<h2>Section2</h2>
		<p>...</p>
	</div>
	<div id="section3" class="tab-pane">
		<h2>Section3</h2>
		<p>...</p>
	</div>
</div>

<!-- 基础的Jquery -->
<script type="text/javascript" src="/cdn.bootcss.com/jquery/3.3.1/jquery.min.js" ></script>
<!-- 基础的bootstrap -->
<script type="text/javascript" src="/cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min.js" ></script>
<script type="text/javascript">
	$(function(){
		var hash = window.location.hash;
		hash && $('ul.nav a[href="'+hash+'"]').tab('show');
		$("#myTab a").click(function(e){
			$(this).tab('show');
		});
	});
</script>
</body>
</html>

效果图:

bootstrap和jQuery下载地址:

https://download.csdn.net/download/Bof_jangle/88614214

相关推荐
姜 萌@cnblogs36 分钟前
Saga Reader 0.9.9 版本亮点:深入解析核心新功能实现
前端·ai·rust
gnip44 分钟前
实现elementplus官网主题切换特效
前端·css
Darling02zjh1 小时前
HTML5
前端·html·html5
成长ing121381 小时前
闪白效果
前端·cocos creator
Lazy_zheng1 小时前
React架构深度解析:从 Stack 到 Fiber,解决 CPU 和 I/O 瓶颈问题
前端·react.js·前端框架
张元清1 小时前
什么是React并发模式中的Tearing(撕裂)
前端·面试
AndyLaw1 小时前
统计字符数错一半,我被 length 坑了两次
前端·javascript
关羽的小刀1 小时前
Element-UI最新版暗藏Lodash漏洞?一次真实项目安全排查记录
前端
张志鹏PHP全栈1 小时前
Vue3第五天,ref 和 reactive的介绍和区别
前端·vue.js
郭邯1 小时前
import.meta对象是什么?
前端