本帖最后由 phpisshow 于 2010-03-29 12:59:02 编辑

解决方案 »

  1.   


    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>js测试</title>
    <style>
    #main{
    width:350px;
    height:20px;
    float:left;
    border:1px solid red;
    }
    .main_son{
    width:80px;
    height:18px;
    margin-left:25px;
    float:left;
    cursor:pointer;
    border:1px solid yellow;
    }
    .old{
    background:#666;
    }
    </style>
    <script src="jquery-1.3.2.js"></script>
    <script>
    $(document).ready(function(){
       $("#first").addClass("old").focus();
       $(".main_son").click(function(){
            $(this).addClass("old").siblings().removeClass("old");
       });
    });
    </script>
    </head>
    <body>
    <div id="main">
         <div class="main_son" id="first">网站首页</div>
         <div class="main_son" id="company">公司简介</div>
         <div class="main_son" id="connect">联系我们</div>
    </div>
    </body>
    </html>不知道是不是符合你的要求,不是的话给我留言
      

  2.   

    lieri111,谢谢回答,但你这个是只在同一个页面。我现在想要的是点击链接跳转到别的页面后。