<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>DHTML TabBar sample. dhtmlXTabBar - Loading Tabbar from XML</title>
<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXTabbar.css">
<script type="text/javascript" src="../js/dhtmlXCommon.js"></script>
<script type="text/javascript" src="../js/dhtmlXTabbar.js"></script>
<style type="text/css">
body {font-family:arial; font-size:12px; font-size:12px}
h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
xmp {color:green;font-size:12px;margin:0;font-family:courier;background-color:#e6e6fa;padding:2px}
div.hdr{
background-color: silver;
margin-bottom:10px;
padding-left:10px;
}
</style>
</head>
<body onload="init()">
<div class="hdr">DHTML JavaScript Tabbar samples</div>
<h1>Loading from XML</h1>
<table>
<tr>
<td>
<div id="a_tabbar" style="width:412px; height:150px;"/>
</td>
<td valign="top">
<textarea id='a1' style="font-family:Tahoma; font-size:8pt; width:350px;" rows="8">
<?xml version="1.0"?>
<tabbar align="left" offset="20" margin="-10" tabstyle="winScarf">
<row>
<tab id="b1" width='100px'>Tab 2-1</tab>
<tab id="b2" width='100px' selected="1">Tab 2-2</tab>
<tab id="b3" width='100px'>Tab 2-3</tab>
<tab id="b4" width='100px'>Tab 2-4</tab>
</row>
</tabbar>
</textarea>
<div>
<a href='#' onclick='tabbar.clearAll(); tabbar.loadXMLString(document.getElementById("a1").value)'>Reload TabBar</a>
</div>
</td>
</table>
<hr>
<XMP>
<div id="a_tabbar" style="width:400px;height:100px"></div>
<script type="text/javascript" >
tabbar=new dhtmlXTabBar("a_tabbar","top");
tabbar.setImagePath("../imgs/");
tabbar.loadXML("tabs_xml.xml");
// or
tabbar.loadXMLString(varString);
</script>
---------tabs.xml---------
<?xml version="1.0"?>
<tabbar align="left" offset="20" margin="-10" tabstyle="winScarf">
<row>
<tab id="a1" width='200px'>Tab 1-1</tab>
<tab id="a2" width='200px'>Tab 1-2</tab>
</row>
<row>
<tab id="b1" width='150px'>Tab 2-1</tab>
<tab id="b2" width='100px' selected="1">Tab 2-2</tab>
<tab id="b3" width='150px'>Tab 2-3</tab>
</row>
</tabbar>
</XMP>
<script type="text/javascript">
function init(){
tabbar=new dhtmlXTabBar("a_tabbar","top");
tabbar.setImagePath("../imgs/");
tabbar.loadXML("tabs1.xml");
}
</script>
<br><br>
<div id="out_zone"></div>
<p><a href="http://www.scbr.com/docs/products/dhtmlxTabbar/index.shtml" style="font-weight:bold;">Go to the dhtmlxTabbar main page</a> or <a href="javascript:self.close()">Close this page</a></p>
</body>
</html>