<div id="foldzone_1">
<tr class="list"> 
<td width="90" align="center" class="title"></td>
</tr>
</div>$('#foldzone_1').toggle(function(){
$(this).hide();
}, function(){
$(this).show();
});
看不出代码有什么问题

解决方案 »

  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" />
    <script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
    <title>无标题文档</title></head><body><div id="foldzone_1">
    <tr class="list">  
    <td width="90" align="center" class="title">11111111</td>
    </tr>
    </div>
    <script>  
      $('#foldzone_1').toggle(function(){
    $(this).hide();
    }, function(){
    $(this).show();
    });</script>  
    </body>
    </html>
      

  2.   

    <!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" />
    <script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
    <title>无标题文档</title></head><body>
    <input type="button" id="btn" title="Click me 你会看到效果" value="点击此处" />
    <div id="content" style="padding:10px; margin-top:5px; border:1px dotted #BBB;"></div>
    <script>  
    $(function(){$("#btn").toggle(function(){$("#content").hide();},
    function(){$("#content").show();});})
    </script>  
    </body>
    </html>正确用法
      

  3.   

    把div去掉,隐藏tr可以,但是写成toggle又不行了,郁闷
      

  4.   

    这样也可以:
    <script>  
    $(function(){$("#btn").click(function(){
    $("#content").slideToggle("fast")
    });})
    </script> 
      

  5.   

    表面上看代码没问题 其实仔细想想是有很大问题的  下面是我的理解:是不是想实现层的hide和show? 
    “#foldzone_1“这个是层的ID,$('#foldzone_1').toggle(function(){
     $(this).hide();
     }, 这句执行完后层已经不再界面上了, 怎么还能实现function(){
     $(this).show();
     });
    这个功能呢,可以做做适当修改。说的不太清楚,望谅解!
      

  6.   

    <!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" />
    <script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
    <title>无标题文档</title>
    <script type="text/javascript">
      
            $(document).ready(function () {
                $('#foldzone_1').toggle(function () {
                    $('.list').hide();
                }, function () {
                    $('.list').show();
                });
            })
        
    </script>  
    <style type="text/css">
        div
    {
    background-color:red;
            height: 54px;
        }
    td
    {background-color:blue;
        }
    </style></head>
    <body><div id="foldzone_1" >
    <table>
    <tr class="list">  
    <td width="90" align="center" class="title">11111111</td>
    </tr>
    </table>
    </div> 
    少用‘this’
      

  7.   

    感觉是js代码没有放到<script>   </script>块中