<script src="http://yui.yahooapis.com/3.7.3/build/yui/yui-min.js"></script>
<!-- a YUI tabview -->
<div id="tb1" class="yui3-skin-sam">
<ul>
<li>
<a href="#foo">foo</a>
</li>
</ul>
<div>
<div id="foo">
<button id="b1">button with problems</button>
</div>
</div>
</div>
<!-- a YUI button -->
<button id="b2">another plain html YUI button</button>
JavaScript
/*my problem with tabview is that if it contains widgets I always must render the tab view AFTER all the other widgets. This is not alwais desired....*/
YUI().use("tabview", "button", function(y){
var tb = new y.TabView({srcNode: "#tb1"});
tb.render();
// Wait until after the tabview renders to scoop up the node refs
var button1El = y.one("#b1");
var button2El = y.one("#b2");
var button1 = new y.Button({srcNode: button1El});
button1.render();
var button2 = new y.Button({srcNode: "#b2"});
button2.render();
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.