I have a jquery ui accordion which works fine. I have the title on the left, and a +/- on the right which I'm using fontawesome for.
Is it possible to add some words next to the +/-? For example expand/collapse.
My code looks like this:
jQuery(document).ready(function($) {
var icons = {
header: "ui-icon-plus icon-large",
activeHeader: "ui-icon-minus icon-large"
};
$( "#accordion" ).accordion({
heightStyle: "content",
icons: icons,
active: false,
collapsible: true,
header: "h3",
navigation: true,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.9.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<div id="accordion">
<h3>Title 1</h3>
<div>
<p>
Text here.
</p>
</div>
<h3>Title 2</h3>
<div>
<p>
Text here.
</p>
</div>
<h3>Title 2</h3>
<div>
<p>
Text here.
</p>
</div>
</div>