我有使用 ui 1.10.0 的 jQuery 选项卡。我的第一个选项卡默认激活;但是,我无法让其他 5 个选项卡工作。当我单击它们时,它们什么也不做,并且与选项卡协调的内容不显示。
这是基本的 HTML 代码:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tabs</title>
<script src="js/jquery-ui-1.10.0.custom.min.js" script type="text/javascript"></script>
<script src="js/jquery-1.9.0.min.js" script type="text/javascript"></script>
<link rel="stylesheet" href="css/jquery-ui-1.10.0.custom.min.css" type="text/css"/>
<link rel="stylesheet" href="css/style.css" type="text/css"/>
</head>
<body>
<div id="simpaleTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all" >
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active">
<a href="#production" class="ui-tabs-anchor">Production</a>
</li>
<li class="ui-state-default ui-corner-top">
<a href="#invoices" class="ui-tabs-anchor">Invoices</a>
</li>
<li class="ui-state-default ui-corner-top">
<a href="#warranty" class="ui-tabs-anchor">Warranty</a>
</li>
<li class="ui-state-default ui-corner-top">
<a href="#services" class="ui-tabs-anchor">Services</a>
</li>
<li class="ui-state-default ui-corner-top">
<a href="#parts" class="ui-tabs-anchor">Parts List</a>
</li>
<li class="ui-state-default ui-corner-top"><a href="#memorandums" class="ui-tabs-anchor">Memorandums</a>
</li>
</ul>
<div id="facebook" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Proudction here
</div>
<div id="twitter" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Invoices here
</div>
<div id="linkedin" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Warranty here
</div>
<div id="google" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Services here
</div>
<div id="wikipedia" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Parts List here
</div>
<div id="picasa" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
content about Memorandums here
</div>
</div>
这是Javascript:
<script>
$(document).ready(function(){
$('#simpaleTabs div').hide();
$('#simpaleTabs div:first').show();
$('#simpaleTabs ul li:first').addclass('active');
$('#simpaleTabs ul li a').click(function(){
$('#simpaleTabs ul li').removeClass('active');
$(this).parent().addClass('active');
var currentTab = $(this).attr('href');
$('#simpaleTabs div').hide();
$(currentTab).show();
return false;
});
});
</script>