请大家帮忙看看该 网址:http://taotao.wsyren.com/jstest/test.htm
用JQUERY写的一个玩意,奇怪的是在我电脑上的IE8上点击了以后边距会全都自动设置为0, 其他浏览器没有问题,但更奇怪的是我在IETEST中的IE8测试预览的时候却又完全正确
搞不懂是代码的问题还是我电脑上安装的IE8的问题

解决方案 »

  1.   

    iecollection测试的也是有问题...
    只有点击第一项的时候正常...
      

  2.   

    我这里的IETest也是同样的问题,LZ的IETest版本是不是老了
    修正好了
    <!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>
    <style type="text/css">
    .cate {
    width: 120px;
    height: 22px;
    display: block;
    font-size: 12px;
    font-weight: bold;
    line-height: 22px;
    margin: 6px 0px;
    padding-left: 20px;
    background-color: Aqua;
    } .cate a {
    color: #0368A8;
    width: 112px;
    } .cate a:hover {
    color: #FF6600;
    text-decoration: underline;
    }
    .brand {
    width: 112px;
    display: block;
    padding-left: 20px;
    line-height: 26px;
    color: #333;
    } .brand a {
    color: #0368A8;
    } .brand a:hover {
    color: #FF6600;
    text-decoration: underline;
    }
    </style>
    <script src="jquery.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    $(function(){
    showfirst();
    /* 点击子类,所有品牌隐藏,显示当前子类的品牌 */
    $(".cate").click(function(){
    $(".brand").hide();
    $(this).next(".brand").show();
    });
    });

    /* 把所有的品牌都隐藏,只显示第一个子类的品牌 */
    function showfirst(){
    $(".brand").hide();
    $(".brand").eq(0).show();
    }
    </script>
    </head>
    <body>
    <div class="cate"><a href="#">CPU</a></div>
    <div class="brand"><a href="#">Intel</a> (98)
    <br/>
    <a href="#">AMD</a> (98)
    <br/>
    </div>
    <div class="cate"><a href="#">主板</a></div>
    <div class="brand"><a href="#">华硕</a> (98)
    <br/>
    <a href="#">微星</a> (98)
    <br/>
    <a href="#">技嘉 </a>(98)
    <br/>
    <a href="#">SUPoX磐正</a> (98)
    <br/>
    <a href="#">映泰</a> (98)
    <br/>
    <a href="#">精英</a> (98)
    <br/>
    <a href="#">华擎</a> (98)
    <br/>
    <a href="#">梅捷</a> (98)
    <br/>
    </div>
    <div class="cate"><a href="#">内存 </a></div>
    <div class="brand"><a href="#">金士顿</a> (98)
    <br/>
    <a href="#">威刚</a> (98)
    <br/>
    <a href="#">胜创</a>(98)
    <br/>
    </div>
    <div class="cate"><a href="#">硬盘 </a></div>
    <div class="brand"><a href="#">西部数据</a> (98)
    <br/>
    <a href="#">希捷</a> (98)
    <br/>
    <a href="#">日立</a>(98)
    <br/>
    </div>
    <div class="cate"><a href="#">显卡 </a></div>
    <div class="brand"><a href="#">迪兰恒进</a> (98)
    <br/>
    <a href="#">铭瑄</a> (98)
    <br/>
    <a href="#">蓝宝石</a>(98)
    <br/>
    </div>
    </body>
    </html>