jQuery tabs() 函数不显示选项卡
以下是我用于创建选项卡式页面的 HTML 代码。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script>
<title>Testing Tabs</title>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#panel1">Panel 1</a></li>
<li><a href="#panel2">Panel 2</a></li>
<li><a href="#panel3">Panel 3</a></li>
</ul>
<div id="panel1">
<p>This is the text of panel 1</p>
</div>
<div id="panel2">
<p>This is the text of panel 2</p>
</div>
<div id="panel3">
<p>This is the text of panel 3</p>
</div>
</div>
</body>
当我在 Firebug 命令行上执行命令 $('#tabs').tabs() (或 $('#tabs').tabs({})) 时,实际上没有任何反应,即链接仍然是链接,并且所有 div显示。
The following is my HTML code for creating a tabbed page.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script>
<title>Testing Tabs</title>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#panel1">Panel 1</a></li>
<li><a href="#panel2">Panel 2</a></li>
<li><a href="#panel3">Panel 3</a></li>
</ul>
<div id="panel1">
<p>This is the text of panel 1</p>
</div>
<div id="panel2">
<p>This is the text of panel 2</p>
</div>
<div id="panel3">
<p>This is the text of panel 3</p>
</div>
</div>
</body>
When I execute the command $('#tabs').tabs() (or $('#tabs').tabs({})) at the Firebug CommandLine, nothing really happens i.e. the links remain links, and all the divs are displayed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保还包含 jQueryUI 样式表。
示例: http://jsfiddle.net/6kg7k/
Make sure you include the jQueryUI stylesheet as well.
Example: http://jsfiddle.net/6kg7k/