在网上找了一个jquery的收缩导航,点击导航上的链接之后,导航就收缩了。
如何能让导航部收缩呢??最简单的方法是什么??? 怎么写呢??????? 谢谢各位高手啦~~~~~

解决方案 »

  1.   

    document.getElementById('xxx').style.display='none';document.getElementById('xxx').style.display='block';
      

  2.   

    $("被点击的DIV的ID什么的").click(function(){
    $("需要收缩的DIV的ID什么的").slideUp();
    });
      

  3.   

    +1$("被点击的DIV的ID什么的").click(function(){
    $(this).slideUp();
    });
      

  4.   

    如果是用ID,比如,id为"divid",那么你引用时,就该写"#divid"
      

  5.   

    $("被点击的DIV的ID什么的").click(function(){
    $("需要收缩的DIV的ID什么的").slideUp();
    });是社会主义未来的花朵
      

  6.   

    <html>
    <head><script type="text/javascript" src="/jquery/jquery.js"></script>
    <script type="text/javascript"> 
    $(document).ready(function(){
    $(".flip").click(function(){
        $(".panel").slideToggle("slow");
      });
    });
    </script>
     
    <style type="text/css"> 
    div.panel,p.flip
    {
    margin:0px;
    padding:5px;
    text-align:center;
    background:#e5eecc;
    border:solid 1px #c3c3c3;
    }
    div.panel
    {
    height:120px;
    display:none;
    }
    </style>
    </head>
     
    <body>
     
    <div class="panel">
    <p>Because time is valuable, we deliver quick and easy learning.</p>
    <p>At W3School, you can study everything you need to learn, in an accessible and handy format.</p>
    </div>
     
    <p class="flip">Show/Hide Panel</p>
     
    </body>
    </html>
    完整代码,
      

  7.   

    右边加iframe,把页面放到iframe里,就不会刷新本页了。
    否则就要ajax了。。
      

  8.   


      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td height="34" align="left" style="background-color: #0A84D7">
                                                                                    <img src="images/left-01.jpg" style="margin-left: 23px" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td height="541" align="center" valign="top" background="images/left-02_r6_c2.jpg">
                                                                                    <ul class="container">
                                                                                        <li class="menu">
                                                                                            <ul>
                                                                                                <li class="button"><a href="#1" rownum="0" id="01" class="blue">行业 <span></span></a></li>
                                                                                                <li class="dropdown">
                                                                                                    <ul>
                                                                                                        <li><a href="TotalOnline.aspx"  id="2">总上线率统计图</a></li>
                                                                                                        <li><a href="CSatisfactionRanking.aspx"  id="3">满意率排行</a></li>
                                                                                                        <li><a href="CdissatisfiedRanking.aspx"  id="4">不满意率排行</a></li>
                                                                                                        <li><a href="CSatisfactionCount.aspx"  id="5">满意率统计图(年,月)</a></li>
                                                                                                        <li><a href="CDissatisfiedCount.aspx"  id="6">不满意率统计图(年,月)</a></li>
                                                                                                        <li><a href="ISatisfactionCount.aspx"  id="7">满意率统计图(总)</a></li>
                                                                                                        <li><a href="IDissatisfiedCount.aspx"  id="8">不满意率统计图(总)</a></li>
                                                                                                        <li><a href="CDissatisfiedContentCount.aspx"  id="9">不满意率各项内容统计图</a></li>
                                                                                                        <li><a href="CServiceEvaluationCount.aspx"  id="10">服务评价统计图</a></li>
                                                                                                    </ul>
                                                                                                </li>
                                                                                            </ul>
                                                                                        </li>
                                                                                        <li class="menu">
                                                                                            <ul>
                                                                                                <li class="button"><a href="#2" class="blue" id="02"  rownum="1">企业<span></span></a></li>
                                                                                                <li class="dropdown">
                                                                                                    <ul>
                                                                                                        <li><a href="CompanyOnlineCount.aspx"  id="12">企业上线率统计表</a></li>
                                                                                                        <li><a href="ISatisfactionRanking.aspx"  id="13">企业内部车辆满意率排名</a></li>
                                                                                                        <li><a href="IDissatisfiedRanking.aspx"  id="14">企业内部车辆不满意率排名</a></li>
                                                                                                        <li><a href="ICDissatisfiedContentCount.aspx"  id="15">企业内部不满意各项统计图</a></li>
                                                                                                        <li><a href="CompanyOnline.aspx"  id="16">企业车辆上线次数统计表</a></li>
                                                                                                        <li><a href="CSatisfactionCompared.aspx"  id="17">企业满意率对比</a></li>
                                                                                                        <li><a href="CDissatisfiedCompared.aspx"  id="18">企业不满意率对比</a></li>
                                                                                                    </ul>
                                                                                                </li>
                                                                                            </ul>
                                                                                        </li>
                                                                                        <li class="menu">
                                                                                            <ul>
                                                                                                <li class="button"><a href="#3" class="blue" id="03" rownum="2">单车 <span></span></a></li>
                                                                                                <li class="dropdown">
                                                                                                    <ul>
                                                                                                        <li><a href="TaxiSatisfactionRanking.aspx"  id="20">单车满意率排行</a></li>
                                                                                                        <li><a href="TaxiDissatisfiedRanking.aspx"  id="21">单车不满意率排名</a></li>
                                                                                                        <li><a href="TaxiServiceEvaluationCount.aspx"  id="22">单车服务评价统计图</a></li>
                                                                                                        <li><a href="TaxiDissatisfiedCount.aspx"  id="23">单车不满意率统计图</a></li>
                                                                                                        <li><a href="TaxiSatisfactionCount.aspx"  id="24">单车满意统计图</a></li>
                                                                                                        <li><a href="TaxiOnline.aspx"  id="25">单车上线次数统计图</a></li>
                                                                                                    </ul>
                                                                                                </li>
                                                                                            </ul>
                                                                                        </li>
                                                                                    </ul>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td height="15">
                                                                                    <img src="images/left-02.jpg" width="250" height="15" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
      

  9.   

    这个是js脚本$(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
    $.easing.def = "easeOutBounce";
    var i=0;
    /* Binding a click event handler to the links: */
    $('li.button a').click(function(e){

    /* Finding the drop down list that corresponds to the current section: */
    var dropDown = $(this).parent().next();
    /* Closing all other drop down sections, except the current one */
    $('.dropdown').not(dropDown).slideUp('slow');
    dropDown.slideToggle('slow');
    $(this).removeClass("blue").addClass("orange");
    //$('li.button a').eq(i).removeClass("orange").addClass("blue");
    //i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */
    e.preventDefault();
    //i++;
    })


    });
      

  10.   

    这个是js脚本$(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
    $.easing.def = "easeOutBounce";
    var i=0;
    /* Binding a click event handler to the links: */
    $('li.button a').click(function(e){

    /* Finding the drop down list that corresponds to the current section: */
    var dropDown = $(this).parent().next();
    /* Closing all other drop down sections, except the current one */
    $('.dropdown').not(dropDown).slideUp('slow');
    dropDown.slideToggle('slow');
    $(this).removeClass("blue").addClass("orange");
    //$('li.button a').eq(i).removeClass("orange").addClass("blue");
    //i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */
    e.preventDefault();
    //i++;
    })


    });
      

  11.   

    我知道LZ的意思了, 实现上就是一个框架布局的效果呀, 但是我可以肯定的是你左边的链接点的时候 右边肯定是重新加载的整个页面,你把右边内容放到一个iframe 里面,然后点左边的链接 右边iframe 动态去根据参数调不同的页面,跟你左边没关系的,所以你左边是什么样子,一直就是什么样子 ,除非你左边是用的 runat="server"控件, 这样的话 你就用JS 或者AJAX来做吧