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

相关推荐
zheshiyangyang10 小时前
前端面试基础知识整理【Day-7】
前端·面试·职场和发展
猫头虎10 小时前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty
qq_242188633211 小时前
3389端口内网转发概述
前端·经验分享·html
Never_Satisfied11 小时前
在JavaScript / HTML中,数组查找第一个符合要求元素
开发语言·javascript·html
伊泽瑞尔11 小时前
2025年终总结
前端·程序员·ai编程
uhakadotcom12 小时前
Hono v4.12.0 发布!路由提速2倍+,JSON响应飞起来
前端·面试·github
少云清12 小时前
【UI自动化测试】10_web自动化测试 _frame切换、多窗口切换
前端·web自动化测试
HelloReader12 小时前
做 IM 客户端,选 Tauri 还是 Qt一篇把坑讲清楚的选型与架构指南
前端
HelloReader12 小时前
Tauri 2 创建项目全流程create-tauri-app 一键脚手架 + Tauri CLI 手动接入
前端·javascript·vue.js
Full Stack Developme12 小时前
语法树与自动化技术
运维·前端·自动化