2009-07-05 76 views
1

我在這裏做錯了什麼?我正在嘗試開始使用jQuery UI選項卡。 現在它不工作。 我以爲我會使用Google版本,以便將其緩存。 我想找到Google的ui.tabs.js。jQuery ui標籤

<html> 
<head> 
<link rel="stylesheet" type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css"> 
<script src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 
google.load("jquery", "1"); 
google.load("jqueryui", "1"); 
google.setOnLoadCallback(function() { 
    $("#myTabs").tabs(); 
}); 
</script> 
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.tabs.js"></script> 
</head> 

<body> 
<ul id="myTabs"> 
    <li><a href="#0"><span>Tab 1</span></a></li> 
    <li><a href="#1"><span>Tab 2</span></a></li> 
</ul> 
<div id="0">This is the content panel linked to the first tab, it is shown by default.</div> 
<div id="1">This content is linked to the second tab and will be shown when its tab is clicked.</div> 
</body> 
</html> 

回答

2

您需要括在同一continer所有標籤:

<div id="myTabs"> 
<ul> 
    <li><a href="#0"><span>Tab 1</span></a></li> 
    <li><a href="#1"><span>Tab 2</span></a></li> 
</ul> 
<div id="0">This is the content panel linked to the first tab, it is shown by default.</div> 
<div id="1">This content is linked to the second tab and will be shown when its tab is clicked.</div> 
</div> 
+0

哦,原來如此!這不是一個好兆頭,因爲這是jQuery UI 1.6書中的示例#1! – 2009-07-05 04:17:46