传智播客的qqtab代码
<!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="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <style type="text/css"> ul{list-style-type:none;border:1px solid blue;} .header{background-color:Red;cursor:pointer;} .bodyer{background-color:Yellow;} </style> <script type="text/javascript"> $(function () { $("ul li:odd").addClass("bodyer"); $("ul li:even").addClass("header").click(function () { $(this).next("li.bodyer").show().siblings("li.bodyer").hide(); }); }) </script> </head> <body> <ul> <li>我的好友</li> <li>哈哈哈3<br />哈哈哈2<br />哈哈哈1<br /></li> <li>我的敌人</li> <li>aaaa<br />bbbb<br />ccc<br /></li> <li>陌生人</li> <li>张三<br />李四<br />王五<br /></li> </ul> </body> </html>