<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="../jquery-1.6.3.js" type="text/javascript"></script>
<style type="text/css">
ul{list-style-type:none;width:100px;}
.hear{background-color:Blue;cursor:pointer;}
.body{border-color:Green;border-width:1px;border-style:;}
</style>
<script type="text/javascript">
$(function () {
$("#qq li:odd").addClass("body");
$("#qq li:even").addClass("hear").click(function () {
$(this).next("li.body").show("fast").siblings("li.body").hide("500");
});
$("#qq li:first").click();//模拟点击
});
</script>
</head>
<body>
<ul id="qq">
<li>我的好友</li>
<li>刘德华<br />周杰伦<br />周星星<br /></li>
<li>我的同学</li>
<li>萨达姆<br />拉登<br />奥巴马<br /></li>
<li>陌生人</li>
<li>郭台铭<br />李彦宏<br />马化腾<br /></li>
</ul>
</body>
</html>
在引用代码前记得引入Jquery的库,这个能实现QQtab的功能。有兴趣的兄弟姐妹们可以一起研究研究