DHTMLX Docs & Samples Explorer

### Attach Accordion to Layout

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="../../../dhtmlxLayout/codebase/dhtmlxlayout.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../dhtmlxLayout/codebase/dhtmlxlayout.css">
    <link rel="stylesheet" type="text/css" href="../../../dhtmlxLayout/codebase/skins/dhtmlxlayout_dhx_skyblue.css">
    <script src="../../codebase/dhtmlxcontainer.js"></script>

    <div id="layoutObj" style="position: relative; top: 20px; left: 20px; width: 600px; height: 400px; aborder: #B5CDE4 1px solid;"></div>
    <script>var dhxLayout,
    dhxAccord;
    function doOnLoad() {
        dhxLayout = new dhtmlXLayoutObject("layoutObj", "3L");
        dhxLayout.cells("a").hideHeader();
        dhxAccord = dhxLayout.cells("a").attachAccordion();
        dhxAccord.addItem("a1", "Main Page");
        dhxAccord.addItem("a2", "Site Navigation");
        dhxAccord.addItem("a3", "Support & Feedback");
        dhxAccord.addItem("a4", "Comments");
        dhxAccord.openItem("a1");
    }</script>