DHTMLX Docs & Samples Explorer

Initialization from the script : object API

Initialization from the script : object API

Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtabbar.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtabbar.js"></script>
 
<h1 id="init_tabbar_from_script">Initialization from the script : object API</h1>
<div id="a_tabbar" style="width:395px; height:390px;"/>
<div id='html_1'><img src="../common/page_a.gif"></div>
<div id='html_2'><img src="../common/page_b.gif"></div>
<script>
tabbar = new dhtmlXTabBar({
    parent: "a_tabbar",
    image_path: "../../codebase/imgs/",
    skin: "dhx_skyblue",
    tabs: [{
        id: "a1",
        label: "Tab 1-1",
        width: "100px"
    }, {
        id: "a2",
        label: "Tab 1-2",
        width: "100px",
        active: true
    }, {
        id: "a3",
        label: "Tab 1-3",
        width: "100px"
    }]
    });
tabbar.setContent("a1", "html_1");
tabbar.setContent("a2", "html_2");
tabbar.setContentHTML("a3", "<br/>The content can be set as <b>HTML</b> node or as <b>HTML</b> text.");
</script>