565N/A <!-- reset the default browser styles --> 565N/A /* Fix this - Shouldn't require body specificity */
565N/A body .yui3-button-selected {
565N/A background-color:#426FD9;
565N/A }).use('button', 'cssbuttons', 'cssfonts', 'console', function(Y){
565N/A Just a basic test with a listener
565N/A // One way of listening for events
565N/A A 'toggle' button listening for the selectedChange event
565N/A Preferably, the user would just apply a yui3-button style to an <
a> element and not use JS
565N/A A group of radio-like buttons
594N/A A group of checkbox-like buttons
565N/A Y.Buttons adds nothing useful for the gernator buttons, so just add the class and a listener.
565N/A Y.all('.generator').addClass('yui3-button').on('click', function(e){
565N/A var button, type, config;
565N/A if (type === 'disabled') {
565N/A <
body class='yui3-skin-sam'>
565N/A <
div id='yconsole'></
div>
565N/A <
h1>Button prototype</
h1>
565N/A <
button id='event' tabindex='3'>Change <
br /> Color</
button>
565N/A <
h2>Toggle w/ event</
h2>
565N/A <
input type='button' id='toggle' value='Toggle'></
input>
565N/A <
button id='disabled'>Should be disabled</
button>
565N/A <
button class='group' id='btn1'>Button 13</
button>
565N/A <
button class='group' id='btn2'>Button 27</
button>
565N/A <
button class='group' id='btn3'>Button 40</
button>
565N/A <
h2>Multi-Group (checkbox)</
h2>
565N/A <
button class='multigroup' id='btn4'>Button 4</
button>
565N/A <
button class='multigroup' id='btn5'>Button 5</
button>
565N/A <
button type='button' class='multigroup' id='btn6'>Button 6</
button>
565N/A <
button class='generator' data-
type='push'>Generate Push Button</
button>
565N/A <
button class='generator' data-
type='toggle'>Generate Toggle Button</
button>
565N/A <
button class='generator' data-
type='disabled'>Generate Disabled Button</
button>
565N/A <
div id='generated' style='border:solid black 1px;'></
div>