<!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>


 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-02-10
  • 2022-01-18
  • 2021-11-17
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2021-11-10
  • 2021-06-09
  • 2021-05-19
  • 2022-12-23
相关资源
相似解决方案