DHTMLX Docs & Samples Explorer

Unloading Accordion

Source
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxaccordion.js"></script>
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxaccordion_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcontainer.js"></script>
 
<div id="accordObj" style="position: relative; width: 320px; height: 400px;"></div>
<input type="button" value="Unload" onclick="unloadAccord();" style="margin-top:20px;">
<script>
var dhxAccord;
function doOnLoad() {
    dhxAccord = new dhtmlXAccordion("accordObj");
    dhxAccord.addItem("a1", "Main Page");
    dhxAccord.addItem("a2", "Site Navigation");
    dhxAccord.addItem("a3", "Support & Feedback");
    dhxAccord.addItem("a4", "Comments");
    dhxAccord.openItem("a1");
}
function unloadAccord() {
    if (!dhxAccord)
        return;
    dhxAccord.unload();
    dhxAccord = null;
}
</script>