JQuery手风琴:交换引导图标
我正在尝试将手风琴集成到我的web应用程序中,我想在点击标题时在V形向下和V形向上图标之间切换。现在,我所拥有的似乎只适用于其他每一个accordion实例(我有一页博客条目,每个条目都有注释,并且注释是可扩展的)。我做错了什么 comments.html.erbJQuery手风琴:交换引导图标,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
<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"
}
});