tabs.html revision 90a4a68f29f441573560c73239959e79a9ddb64c
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Tabs</title>
<script type="text/javascript" src="/build/yui/yui-min.js"></script>
<style>
ul, li {
margin: 0;
padding: 0;
}
</style>
</head>
<body class="yui3-skin-sam">
<h1>Tabs</h1>
<div id="demo">
</div>
<div id="demo2">
<ul>
<li><a>foo</a></li>
<li><a>bar</a></li>
<li><a>baz</a></li>
</ul>
<div>
<div>foo content</div>
<div>bar content</div>
<div>baz content</div>
</div>
</div>
</body>
<script type="text/javascript">
YUI({filter: 'raw'}).use('tabview', function(Y) {
var tabview = new Y.TabView({
boundingBox: '#demo',
children: [{
label: 'tab 1',
content: 'tab 1 content'
}, {
label: 'tab 2',
content: 'tab 2 content',
selection: 1
}, {
label: 'tab 3',
content: 'tab 3 content'
}]
});
tabview.render();
//tabview.selectChild(0);
//tabview.remove(0);
//tablist.get('selection').next().set('selected', 1);
var tabview2 = new Y.TabView({
contentBox: '#demo2'
});
tabview2.render();
tabview2.add({
label: 'foobar',
content: 'foobar content'
});
console.log(tabview2.get('contentBox').focusManager.get('descendants'));
tabview2.selectChild(2);
//tabview2.add(tabview.item(1));
});
</script>
</html>