DHTMLX Docs & Samples Explorer

Attach Accordion to Window

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="../../../dhtmlxWindows/codebase/dhtmlxwindows.js"></script>
<link rel="stylesheet" type="text/css" href="../../../dhtmlxWindows/codebase/dhtmlxwindows.css">
<link rel="stylesheet" type="text/css" href="../../../dhtmlxWindows/codebase/skins/dhtmlxwindows_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcontainer.js"></script>
 
<div id="winVP" style="position: relative; height: 500px; border: #cecece 1px solid; margin: 10px;"></div>
<script>
var dhxWins,
w1,
dhxAccord;
function doOnLoad() {
    dhxWins = new dhtmlXWindows();
    dhxWins.enableAutoViewport(false);
    dhxWins.attachViewportTo("winVP");
    dhxWins.setImagePath("../../../dhtmlxWindows/codebase/imgs/");
    w1 = dhxWins.createWindow("w1", 20, 30, 400, 350);
    w1.setText("dhtmlxWindow with dhtmlxAccordion");
    dhxAccord = w1.attachAccordion();
    dhxAccord.addItem("a1", "Main Page");
    dhxAccord.addItem("a2", "Site Navigation");
    dhxAccord.addItem("a3", "Support & Feedback");
    dhxAccord.addItem("a4", "Comments");
    dhxAccord.openItem("a1");
}
</script>