<style>
#myTabs {width: 100%; height: 30px;}
#myTabs .aw-list-item {color: blue}
/* each element has unique ID, check with Firefox DOM Inspector :-) */
#myTabs-item-1 {font-weight: bold}
#myTabs-item-2-box-text {border-bottom: 2px solid red}
</style>
<script>
var obj = new AW.UI.Tabs;
obj.setId("myTabs");
var items = ["Home", "Favorites", "Font size", "Search"];
obj.setItemText(items);
var images = ["home", "favorites", "fontsize", "search"];
obj.setItemImage(images);
obj.setItemCount(4);
obj.setSelectedItems([1]);
document.write(obj);
</script>
<div style="border-top: 1px solid #999">
</div>
<p></p>
<script>
var add = new AW.UI.Button;
add.setControlText("Add");
document.write(add);
add.onClick = function(){
items[items.length] = "another";
images[images.length] = "Home";
obj.setItemCount(items.length);
obj.setItemText(items);
obj.setItemImage(images);
obj.refresh();
}
var del = new AW.UI.Button;
del.setControlText("Del");
document.write(del);
del.onClick = function(){
if(items.length == 0) return;
items.length = items.length-1;
images.length = images.length-1;
obj.setItemCount(items.length);
obj.setItemText(items);
obj.setItemImage(images);
obj.refresh();
}
</script>
This topic is archived.