試試這個請:http://jsfiddle.net/wZPzB/
很好的鏈接:http://jqueryui.com/demos/tabs/
不甚清楚,你的意思是不使用下面的腳本JQ工具不使用工具的lib怎麼辦。
希望它適合原因! :)
腳本
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/lib/jquery.lint-11-06.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css">
代碼 ==>$("#tabs").tabs();
var $tabsList = $("<ul></ul>");
$(".tab h3")
.each(function(idx) {
var $this = $(this),
tabId = "tabs-" + idx;
$tabsList.append("<li><a href='#" + tabId + "'>" + $this.text() + "</a></li>");
$this
.parent()
.removeClass("tab")
.attr("id", tabId);
$this.remove();
});
$tabsList.prependTo(".tabs");
$(".tabs").tabs();