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

相关推荐
渣波1 分钟前
深度解析工厂模式:从蜜雪冰城到 NestFactory,彻底搞懂“创建与使用分离”
前端·javascript
蔓越莓2 分钟前
打包工具:编译器ESBuild
前端·面试
用户921080262863 分钟前
Bubble 的 loading 和 typing:AI 回复生成中的交互处理
前端
SamChan907 分钟前
用Playwright端到端测试PDF翻译功能:Web自动化测试实战
前端·python·ai·pdf·wpf
平生不晚11 分钟前
在 SVG 体系里画一条任意的线
前端·算法
用户0595401744628 分钟前
把大模型记忆召回测试从 30 分钟手工核对压到 3 秒自动化,pytest + FAISS 这套组合救了我
前端·css
醉里博客29 分钟前
醉里起始页 Snavigation2.0:纯前端导航页的二开改造与性能优化实践
前端
雪芽蓝域zzs43 分钟前
新建前端pnpm(vue js ) 仿若依项目(一)
前端·javascript·vue.js
vipbic44 分钟前
网站升级了,我却有点舍不得
前端·vue.js·后端
IT_陈寒44 分钟前
Java Stream并行处理让我数据库崩了两次
前端·人工智能·后端