【发布时间】:2017-01-09 07:03:13
【问题描述】:
我有手风琴,同时点击它展开(打开),但当我再次点击它时,它没有关闭手风琴。如何更改功能,以便在我第二次点击手风琴时关闭手风琴。
$(function() {
var icons = {
header: "ui-icon-circle-arrow-e",
activeHeader: "ui-icon-circle-arrow-s"
};
$("#accordion").accordion({
icons: icons
});
$("#toggle").button().on("click", function() {
if ($("#accordion").accordion("option", "icons")) {
$("#accordion").accordion("option", "icons", null);
} else {
$("#accordion").accordion("option", "icons", icons);
}
});
});
<section class="content">
<h1 style="color:#B94A7E"> header 1</h1>
<div id="accordion">
<h3 style="font-size:16px">header 3</h3>
<div>
<table>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<font color="#5a5453">
4. The actual IoT platform that builds, connects and manages includes all APIs, Web services, application
services, agents, connectivity etc
</font>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
【问题讨论】:
标签: javascript jquery html twitter-bootstrap jquery-ui