Skip to content

Instantly share code, notes, and snippets.

@benediktarnold
Created May 4, 2012 07:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benediktarnold/2592951 to your computer and use it in GitHub Desktop.
Save benediktarnold/2592951 to your computer and use it in GitHub Desktop.
In this example you can see a sortable yui3 tabview with drag and drop.
<!doctype html>
<html>
<head>
<title>
</title>
<script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js">
</script>
</head>
<body class="yui3-skin-sam">
<script type="text/javascript">
// Create a new YUI instance and populate it with the required modules.
YUI({
filter: 'RAW'
}).use(['tabview','sortable'], function(Y) {
var tabview2 = new Y.TabView({
children: [{
label: 'foo2',
content: '<p>foo content</p>'
}, {
label: 'bar2',
content: '<p>bar content</p>'
}, {
label: 'baz2',
content: '<p>baz content</p>'
}]
});
tabview2.render('#target');
var sortable = new Y.Sortable({
container: tabview2.get('contentBox'),
nodes: 'li',
opacity: '.4'
});
sortable.delegate.dd.removeInvalid('a');
});
</script>
<div id="target">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment