Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在舞台上运行时,协调不同的行为_Javascript_Jquery_Ruby_Ruby On Rails 3_Accordion - Fatal编程技术网

Javascript 在舞台上运行时,协调不同的行为

Javascript 在舞台上运行时,协调不同的行为,javascript,jquery,ruby,ruby-on-rails-3,accordion,Javascript,Jquery,Ruby,Ruby On Rails 3,Accordion,我目前正在使用RubyonRails开发一个网站。我已经把手风琴放在表格里了 <div id="accordion" class="accordion no-margin"> <div class="accordion-group"> <div class="accordion-heading"> <a href="#accordion-ci" data-parent="#accordion" data-toggle="colla

我目前正在使用RubyonRails开发一个网站。我已经把手风琴放在表格里了

<div id="accordion" class="accordion no-margin">
  <div class="accordion-group">
    <div class="accordion-heading">
      <a href="#accordion-ci" data-parent="#accordion" data-toggle="collapse" class="accordion-toggle">
        <i class="icon-th"></i>
              COMMERCIAL ITEM
      </a>
    </div>
    <div class="accordion-body in collapse" id="accordion-ci" style="height: auto;">
      <div class="accordion-inner">
            <!--
              revised by: hansen.salim@nutrifood.co.id, August 31st 2017
              adding id to connect to JS for drag n drop
            -->
              <!--<table class="table table-condensed table-striped table-bordered table-hover no-margin">-->
        <table class="table table-condensed table-striped table-bordered table-hover no-margin" id="sortable">
          <thead>
            <tr>
              <th style="width:20%">ITEM DESCRIPTION</th>
              <th style="width:20%">SECONDARY ITEM DESCRIPTION</th>
              <th style="width:10%">PRICE</th>
              <th style="width:8%">PRICE ON MASTER</th>
              <th style="width:8%">QUANTITY</th>
              <th style="width:9%">VOLUME (CBM)</th>
              <th style="width:9%">WEIGHT (KG)</th>
              <th style="width:10%">TOTAL FOB (USD)</th>
              <th style="width:6%">ACTION</th>
            </tr>
          </thead>
          <tbody id="ci">
            <%= render partial: 'item_detail', collection: @ci_products %>
              <tr>
                <td colspan="9">
                  <ul>
                    <li>
                      <a href="#" class="add_buyer_sales_contract_detail btn btn-success" data-icon=""></a>
                    </li>
                  </ul>
                </td>
              </tr>
            </tbody>
        </table>
        <br />
      </div>
    </div>
  </div>
</div>
这是实现手风琴的折叠函数。我尝试添加警报以检查javascript和jquery是否工作。当我在登台时再次测试它时,在单击标题后,警报“隐藏”起作用(因为默认的表单是打开的),然后弹出另一个警报“打开”。看来这两个

 hide()

功能同时工作。我不知道为什么会发生这种情况,而我的本地服务器工作得很好

 hide()
 show()