<!DOCTYPE <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jquery导航栏</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
</head>
<body>
<div id="container">
<ul>
<li><a href="#tab1">这是标签1</a></li>
<li><a href="#tab2">这是标签2</a></li>
<li><a href="#tab3">这是标签3</a></li>
</ul>
<div id="tab1">
<p>这里是标签1的内容</p>
</div>
<div id="tab2">
<p>这里是标签2的内容</p>
<ul>
<li>桃子</li>
<li>西瓜</li>
<li>桔子</li>
</ul>
</div>
<div id="tab3">
<p>这里是标签3的内容</p>
</div>
</div>
<script>
$(function(){
$("#container").tabs();
})
</script>
</body>
网友评论