many.html revision 59f46e3ac39a4447080c957ac93d78bb41a66eea
6425N/A<!DOCTYPE html>
6330N/A<html>
6330N/A <head>
6330N/A <!-- reset the default browser styles -->
6330N/A <style>
6330N/A
6330N/A /* Fix this - Shouldn't require body specificity */
6330N/A body .yui3-button-selected {
6330N/A background-color:#426FD9;
6330N/A color:white;
6330N/A }
6330N/A
6330N/A </style>
6330N/A
6330N/A <script src='/build/yui/yui-min.js'></script>
6330N/A
6330N/A <script>
6330N/A
6330N/A YUI.add('buttons', function(Y){
6330N/A
6330N/A var Buttons = function(config){
6330N/A
6330N/A var buttons = [];
6330N/A
6330N/A config.srcNodes.each(function(node){
6330N/A var button = new Y.Button({
6330N/A type: config.type,
6330N/A srcNode: node
6330N/A });
6330N/A buttons.push(button);
6330N/A });
6330N/A
6330N/A return buttons;
6330N/A }
6330N/A
6330N/A Y.Buttons = Buttons;
6374N/A });
6374N/A
6374N/A YUI({
6330N/A debug: true,
6330N/A combo: false,
6330N/A filter: 'raw'
6330N/A }).use('button', 'buttons', 'button-group', function(Y){
6330N/A
6330N/A Y.one("#generator").on("click", function(){
6330N/A
6330N/A var count, button, buttons = [];
6330N/A
6330N/A count = Y.one('#count').get('value');
6330N/A
6330N/A Y.one("#container").empty(true);
6330N/A
6330N/A for(var i=0; i < count; i++) {
6330N/A button = new Y.ButtonGenerator( {label: i} );
6330N/A Y.one("#container").append(button.get('srcNode'));
6330N/A buttons.push(button);
6330N/A }
6330N/A
6330N/A new Y.ButtonGroup({
6330N/A buttons: buttons,
6330N/A type: 'radio'
6330N/A });
6330N/A });
6330N/A
6330N/A });
6330N/A </script>
6330N/A </head>
6330N/A
6330N/A <body class='yui3-skin-sam'>
6330N/A
6330N/A <h1>Buttonpalooza</h1>
6330N/A How many buttons would you like?<input type="text" value="100" id="count">
6330N/A <br /><br />
6330N/A <button id="generator" class="yui3-button">Click to make a lot of buttons</button>
6330N/A <hr />
6330N/A <div id="container"></div>
6330N/A </body>
6330N/A</html>