jquery隐藏/显示多个div /表在第二次单击时出错

时间:2015-10-26 11:35:12

标签: jquery

$(document).each(function (){
     $(".issue_load").on('click',function (){
      //$('.div'+$(this).attr('target')).show();
       $(".copytab2").hide();
     });
});

$(document).each(function (){
     $("#receipt_load").on('click',function (){
        $(".copytabl").hide();
        $(".copytab2").show();
     });
}); 
<div class ="form-group recept_fetch">
<table class ="table table-condensed table-striped table-bordered table-hover copytab2">
<thead>
 <tr id = "recgridview"></tr>
</thead>
<tbody class = "recptdt">
</tbody>
</table>
</div>
<div class ="form-group fetch_request">
<table class ="table table-condensed table-striped table-bordered table-hover copytabl">
<thead>
<tr id = "gridview"></tr> 
</thead>
<tbody class = "billdt">
</tbody>
</table>
</div>

对于第一次点击,当第二次点击时,copytabl无法显示copytabl.Am尝试这样的事情。当我点击issue_load时,应该显示.copytabl并且receipt_load应该显示.copytab2再次同样点击issue_load show .copytabl甚至尝试添加div相同的概率。

<div class="form-group tblalt">
<table class = " table-striped table-bordered table-condensed header-fixed issue_load scroll" style = "width:50%" id = "request_ids">
<thead>
<tr id = "newtbl2">
<th  style = "width:44%">Indent Req No</th>
<th >Date</th>
</tr>
</thead>
<tbody id ="cur" class = "patdetails Tbodycontent">

</tbody> 
</table>
</div>



<div class="form-group tblalt1" style = "width:85%" id = "receipt_load">

<table class = "table table-striped table-bordered table-condensed header-fixed receipt_load scroll">

<thead>
<tr id = "newtbl1">
<th>Indent Issue No</th>
<th>Date</th>
<th>Req.No</th>
<th>Date</th>                           
</tr>
</thead>
<tbody id ="recpnum" class = "patdetails Tbodycontent1 text-center">


</tbody> 
</tbody> 

</table>

</di

V&GT;

0 个答案:

没有答案