Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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
JQuery手风琴:交换引导图标_Jquery_Jquery Ui_Accordion - Fatal编程技术网

JQuery手风琴:交换引导图标

JQuery手风琴:交换引导图标,jquery,jquery-ui,accordion,Jquery,Jquery Ui,Accordion,我正在尝试将手风琴集成到我的web应用程序中,我想在点击标题时在V形向下和V形向上图标之间切换。现在,我所拥有的似乎只适用于其他每一个accordion实例(我有一页博客条目,每个条目都有注释,并且注释是可扩展的)。我做错了什么 comments.html.erb <div class="userComments"> <div class="accordion"> <h5 class="icon-chevron-down"> Comm

我正在尝试将手风琴集成到我的web应用程序中,我想在点击标题时在V形向下和V形向上图标之间切换。现在,我所拥有的似乎只适用于其他每一个accordion实例(我有一页博客条目,每个条目都有注释,并且注释是可扩展的)。我做错了什么

comments.html.erb

   <div class="userComments">
    <div class="accordion">
      <h5 class="icon-chevron-down"> Comments (<%=step.comment_threads.count%>)</h5>
      <div class="comment">  
        <div class="userIcon">
          <%= image_tag(current_user.avatar_url(:thumb), :class=>"commentAvatar img-polaroid")%>
        </div class="addComment">
           <%= semantic_form_for([@project, step, step.comment_threads.build]) do |f| %>
            <div class="field">
              <%= f.text_area :body %>
            </div>
        <div class="submit">
          <%= f.submit :comment, :class=> "btn btn-small btn-primary commentSubmit" %>
        </div>
        <% end %>

         <div class="clear"></div>
      <div class="stepComments">
        <% if step.comment_threads.count >0 %>
          <% step.comment_threads.each do |stepComment| %>
            <% if stepComment.body.length>0 %>
              <%= render :partial => 'comments', :locals => {:comment=> stepComment, :step=>step} %>
            <% end %>
          <% end %>
        <% end %>
      </div>
    </div>
      </div>
    </div>

以下是我如何解决的:

    $('.accordion').accordion({
      collapsible: true, 
      heightStyle: "content",
      active: false,
      icons:{
        header: "icon-chevron-down",
        activeHeader: "icon-chevron-up"
      }
    });
然后我删除了标题的类规范

    $('.accordion').accordion({
      collapsible: true, 
      heightStyle: "content",
      active: false,
      icons:{
        header: "icon-chevron-down",
        activeHeader: "icon-chevron-up"
      }
    });