273 lines
34 KiB
HTML
273 lines
34 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>jQuery UI button documentation</title>
|
|
|
|
<style>
|
|
body {
|
|
font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"
|
|
}
|
|
.gutter {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<script>{
|
|
"title":
|
|
"Button Widget",
|
|
"excerpt":
|
|
"Themable buttons and button sets.",
|
|
"termSlugs": {
|
|
"category": [
|
|
"widgets"
|
|
]
|
|
}
|
|
}</script><article id="button1" class="entry widget"><h2 class="section-title">
|
|
<span>Button Widget</span><span class="version-details">version added: 1.8</span>
|
|
</h2>
|
|
<div class="entry-wrapper">
|
|
<p class="desc"><strong>Description: </strong>Themable buttons and button sets.</p>
|
|
<section id="quick-nav"><header><h2>QuickNav<a href="#entry-examples">Examples</a>
|
|
</h2></header><div class="quick-nav-section">
|
|
<h3>Options</h3>
|
|
<div><a href="#option-disabled">disabled</a></div>
|
|
<div><a href="#option-icons">icons</a></div>
|
|
<div><a href="#option-label">label</a></div>
|
|
<div><a href="#option-text">text</a></div>
|
|
</div>
|
|
<div class="quick-nav-section">
|
|
<h3>Methods</h3>
|
|
<div><a href="#method-destroy">destroy</a></div>
|
|
<div><a href="#method-disable">disable</a></div>
|
|
<div><a href="#method-enable">enable</a></div>
|
|
<div><a href="#method-refresh">refresh</a></div>
|
|
<div><a href="#method-option">option</a></div>
|
|
<div><a href="#method-widget">widget</a></div>
|
|
</div>
|
|
<div class="quick-nav-section">
|
|
<h3>Events</h3>
|
|
<div><a href="#event-create">create</a></div>
|
|
</div></section><div class="longdesc" id="entry-longdesc">
|
|
<p>Button enhances standard form elements like buttons, inputs and anchors to themable buttons with appropiate hover and active styles.</p>
|
|
|
|
<p>In addition to basic push buttons, radio buttons and checkboxes (inputs of type radio and checkbox) can be converted to buttons. Their associated label is styled to appear as the button, while the underlying input is updated on click. For the association to work properly, give the input an <code>id</code> attribute, and refer to that in the label's <code>for</code> attribute. Don't nest the input inside the label, as that <a href="http://www.paciellogroup.com/blog/2011/07/html5-accessibility-chops-form-control-labeling/">causes accessbility problems</a>.</p>
|
|
|
|
<p>In order to group radio buttons, Button also provides an additional widget, called Buttonset. Buttonset is used by selecting a container element (which contains the radio buttons) and calling <code>.buttonset()</code>. Buttonset will also provide visual grouping, and therefore should be used whenever you have a group of buttons. It works by selecting all descendants and applying <code>.button()</code> to them. You can enable and disable a button set, which will enable and disable all contained buttons. Destroying a button set also calls each button's <code>destroy</code> method.</p>
|
|
|
|
<p>When using an input of type button, submit or reset, support is limited to plain text labels with no icons.</p>
|
|
</div>
|
|
<h3>Additional Notes:</h3>
|
|
<div class="longdesc"><ul><li>
|
|
This widget requires some functional CSS, otherwise it won't work. If you build a custom theme, use the widget's specific CSS file as a starting point.
|
|
</li></ul></div>
|
|
<section id="options"><header><h2 class="underline">Options</h2></header><div id="option-disabled" class="api-item first-item">
|
|
<h3>disabled<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a></span>
|
|
</h3>
|
|
<div class="default">
|
|
<strong>Default: </strong><code>false</code>
|
|
</div>
|
|
<div>Disables the button if set to <code>true</code>.</div>
|
|
<strong>Code examples:</strong><p>Initialize the button with the disabled option specified:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button({ disabled: </code><code class="keyword">true</code> <code class="plain">});</code></div></div></td></tr></tbody></table></div>
|
|
<p>Get or set the disabled option, after initialization:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">disabled = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2"> </div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code><code class="plain">, </code><code class="keyword">true</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
<div id="option-icons" class="api-item">
|
|
<h3>icons<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Object">Object</a></span>
|
|
</h3>
|
|
<div class="default">
|
|
<strong>Default: </strong><code>{ primary: null, secondary: null }</code>
|
|
</div>
|
|
<div>Icons to display, with or without text (see <a href="#option-text"><code>text</code></a> option). By default, the primary icon is displayed on the left of the label text and the secondary is displayed on the right. The positioning can be controlled via CSS. The value for the <code>primary</code> and <code>secondary</code> properties must be a class name, e.g., <code>"ui-icon-gear"</code>. For using only one icon: <code>icons: { primary: "ui-icon-locked" }</code>. For using two icons: <code>icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" }</code>.</div>
|
|
<strong>Code examples:</strong><p>Initialize the button with the icons option specified:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button({ icons: { primary: </code><code class="string">"ui-icon-gear"</code><code class="plain">, secondary: </code><code class="string">"ui-icon-triangle-1-s"</code> <code class="plain">} });</code></div></div></td></tr></tbody></table></div>
|
|
<p>Get or set the icons option, after initialization:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">icons = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"icons"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2"> </div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"icons"</code><code class="plain">, { primary: </code><code class="string">"ui-icon-gear"</code><code class="plain">, secondary: </code><code class="string">"ui-icon-triangle-1-s"</code> <code class="plain">} );</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
<div id="option-label" class="api-item">
|
|
<h3>label<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#String">String</a></span>
|
|
</h3>
|
|
<div class="default">
|
|
<strong>Default: </strong><code>null</code>
|
|
</div>
|
|
<div>Text to show in the button. When not specified (<code>null</code>), the element's HTML content is used, or its <code>value</code> attribute if the element is an input element of type submit or reset, or the HTML content of the associated label element if the element is an input of type radio or checkbox.</div>
|
|
<strong>Code examples:</strong><p>Initialize the button with the label option specified:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button({ label: </code><code class="string">"custom label"</code> <code class="plain">});</code></div></div></td></tr></tbody></table></div>
|
|
<p>Get or set the label option, after initialization:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">label = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"label"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2"> </div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"label"</code><code class="plain">, </code><code class="string">"custom label"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
<div id="option-text" class="api-item">
|
|
<h3>text<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a></span>
|
|
</h3>
|
|
<div class="default">
|
|
<strong>Default: </strong><code>true</code>
|
|
</div>
|
|
<div>Whether to show the label. When set to <code>false</code> no text will be displayed, but the <a href="#options-icons"><code>icons</code></a> option must be enabled, otherwise the <code>text</code> option will be ignored.</div>
|
|
<strong>Code examples:</strong><p>Initialize the button with the text option specified:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button({ text: </code><code class="keyword">false</code> <code class="plain">});</code></div></div></td></tr></tbody></table></div>
|
|
<p>Get or set the text option, after initialization:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">text = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"text"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2"> </div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"text"</code><code class="plain">, </code><code class="keyword">false</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div></section><section id="methods"><header><h2 class="underline">Methods</h2></header><div id="method-destroy"><div class="api-item first-item">
|
|
<h3>destroy()</h3>
|
|
<div>
|
|
Removes the button functionality completely. This will return the element back to its pre-init state.
|
|
</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the destroy method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"destroy"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></div>
|
|
<div id="method-disable"><div class="api-item">
|
|
<h3>disable()</h3>
|
|
<div>
|
|
Disables the button.
|
|
</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the disable method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"disable"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></div>
|
|
<div id="method-enable"><div class="api-item">
|
|
<h3>enable()</h3>
|
|
<div>
|
|
Enables the button.
|
|
</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the enable method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"enable"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></div>
|
|
<div id="method-option">
|
|
<div class="api-item">
|
|
<h3>option( optionName )<span class="returns">Returns: <a href="http://api.jquery.com/Types#Object">Object</a></span>
|
|
</h3>
|
|
<div>Gets the value currently associated with the specified <code>optionName</code>.</div>
|
|
<ul><li>
|
|
<div><strong>optionName</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#String">String</a>
|
|
</div>
|
|
<div>The name of the option to get.</div>
|
|
</li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="keyword">var</code> <code class="plain">isDisabled = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="api-item">
|
|
<h3>option()<span class="returns">Returns: <a href="http://api.jquery.com/Types#PlainObject">PlainObject</a></span>
|
|
</h3>
|
|
<div>Gets an object containing key/value pairs representing the current button options hash.</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="keyword">var</code> <code class="plain">options = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="api-item">
|
|
<h3>option( optionName, value )</h3>
|
|
<div>Sets the value of the button option associated with the specified <code>optionName</code>.</div>
|
|
<ul>
|
|
<li>
|
|
<div><strong>optionName</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#String">String</a>
|
|
</div>
|
|
<div>The name of the option to set.</div>
|
|
</li>
|
|
<li>
|
|
<div><strong>value</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
|
|
</div>
|
|
<div>A value to set for the option.</div>
|
|
</li>
|
|
</ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code><code class="plain">, </code><code class="keyword">true</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="api-item">
|
|
<h3>option( options )</h3>
|
|
<div>Sets one or more options for the button.</div>
|
|
<ul><li>
|
|
<div><strong>options</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
|
|
</div>
|
|
<div>A map of option-value pairs to set.</div>
|
|
</li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"option"</code><code class="plain">, { disabled: </code><code class="keyword">true</code> <code class="plain">} );</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="method-refresh"><div class="api-item">
|
|
<h3>refresh()</h3>
|
|
<div>Refreshes the visual state of the button. Useful for updating button state after the native element's checked or disabled state is changed programmatically.</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the refresh method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"refresh"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></div>
|
|
<div id="method-widget"><div class="api-item">
|
|
<h3>widget()<span class="returns">Returns: <a href="http://api.jquery.com/Types#jQuery">jQuery</a></span>
|
|
</h3>
|
|
<div>
|
|
Returns a <code>jQuery</code> object containing the element visually representing the button.
|
|
</div>
|
|
<ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Invoke the widget method:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="keyword">var</code> <code class="plain">widget = $( </code><code class="string">".selector"</code> <code class="plain">).button( </code><code class="string">"widget"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></div></section><section id="events"><header><h2 class="underline">Events</h2></header><div id="event-create" class="api-item first-item">
|
|
<h3>create( event, ui )<span class="returns">Type: <code>buttoncreate</code></span>
|
|
</h3>
|
|
<div>
|
|
Triggered when the button is created.
|
|
</div>
|
|
<ul>
|
|
<li>
|
|
<div><strong>event</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
|
|
</div>
|
|
<div></div>
|
|
</li>
|
|
<li>
|
|
<div><strong>ui</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
|
|
</div>
|
|
<div></div>
|
|
</li>
|
|
</ul>
|
|
<div>
|
|
<strong>Code examples:</strong><p>Initialize the button with the create callback specified:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).button({</code></div><div class="line number2 index1 alt1"><code class="undefined spaces"> </code><code class="plain">create: </code><code class="keyword">function</code><code class="plain">( event, ui ) {}</code></div><div class="line number3 index2 alt2"><code class="plain">});</code></div></div></td></tr></tbody></table></div>
|
|
<p>Bind an event listener to the buttoncreate event:</p>
|
|
<div class="syntaxhighlighter nogutter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).on( </code><code class="string">"buttoncreate"</code><code class="plain">, </code><code class="keyword">function</code><code class="plain">( event, ui ) {} );</code></div></div></td></tr></tbody></table></div>
|
|
</div>
|
|
</div></section><section class="entry-examples" id="entry-examples"><header><h2 class="underline">Examples:</h2></header><div class="entry-example" id="example-0">
|
|
<h4>Example: <span class="desc">A simple jQuery UI Button</span>
|
|
</h4>
|
|
<div class="syntaxhighlighter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain"><!doctype html></code></div><div class="line number2 index1 alt1"><code class="plain"><</code><code class="keyword">html</code> <code class="color1">lang</code><code class="plain">=</code><code class="string">"en"</code><code class="plain">></code></div><div class="line number3 index2 alt2"><code class="plain"><</code><code class="keyword">head</code><code class="plain">></code></div><div class="line number4 index3 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">meta</code> <code class="color1">charset</code><code class="plain">=</code><code class="string">"utf-8"</code><code class="plain">></code></div><div class="line number5 index4 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">title</code><code class="plain">>button demo</</code><code class="keyword">title</code><code class="plain">></code></div><div class="line number6 index5 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">link</code> <code class="color1">rel</code><code class="plain">=</code><code class="string">"stylesheet"</code> <code class="color1">href</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css</a>"</code><code class="plain">></code></div><div class="line number7 index6 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/jquery-1.8.3.js">http://code.jquery.com/jquery-1.8.3.js</a>"</code><code class="plain">></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number8 index7 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.2/jquery-ui.js">http://code.jquery.com/ui/1.9.2/jquery-ui.js</a>"</code><code class="plain">></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number9 index8 alt2"><code class="plain"></</code><code class="keyword">head</code><code class="plain">></code></div><div class="line number10 index9 alt1"><code class="plain"><</code><code class="keyword">body</code><code class="plain">></code></div><div class="line number11 index10 alt2"> </div><div class="line number12 index11 alt1"><code class="plain"><</code><code class="keyword">button</code><code class="plain">>Button label</</code><code class="keyword">button</code><code class="plain">></code></div><div class="line number13 index12 alt2"> </div><div class="line number14 index13 alt1"><code class="plain"><</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number15 index14 alt2"><code class="plain">$( "button" ).button();</code></div><div class="line number16 index15 alt1"><code class="plain"></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number17 index16 alt2"> </div><div class="line number18 index17 alt1"><code class="plain"></</code><code class="keyword">body</code><code class="plain">></code></div><div class="line number19 index18 alt2"><code class="plain"></</code><code class="keyword">html</code><code class="plain">></code></div></div></td></tr></tbody></table></div>
|
|
<h4>Demo:</h4>
|
|
<div class="demo code-demo" data-height="100"></div>
|
|
</div>
|
|
<div class="entry-example" id="example-1">
|
|
<h4>Example: <span class="desc">A simple jQuery UI Buttonset</span>
|
|
</h4>
|
|
<div class="syntaxhighlighter "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div><div class="line number20 index19 alt1">20</div><div class="line number21 index20 alt2">21</div><div class="line number22 index21 alt1">22</div><div class="line number23 index22 alt2">23</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain"><!doctype html></code></div><div class="line number2 index1 alt1"><code class="plain"><</code><code class="keyword">html</code> <code class="color1">lang</code><code class="plain">=</code><code class="string">"en"</code><code class="plain">></code></div><div class="line number3 index2 alt2"><code class="plain"><</code><code class="keyword">head</code><code class="plain">></code></div><div class="line number4 index3 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">meta</code> <code class="color1">charset</code><code class="plain">=</code><code class="string">"utf-8"</code><code class="plain">></code></div><div class="line number5 index4 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">title</code><code class="plain">>button demo</</code><code class="keyword">title</code><code class="plain">></code></div><div class="line number6 index5 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">link</code> <code class="color1">rel</code><code class="plain">=</code><code class="string">"stylesheet"</code> <code class="color1">href</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css</a>"</code><code class="plain">></code></div><div class="line number7 index6 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/jquery-1.8.3.js">http://code.jquery.com/jquery-1.8.3.js</a>"</code><code class="plain">></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number8 index7 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">script</code> <code class="color1">src</code><code class="plain">=</code><code class="string">"<a href="http://code.jquery.com/ui/1.9.2/jquery-ui.js">http://code.jquery.com/ui/1.9.2/jquery-ui.js</a>"</code><code class="plain">></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number9 index8 alt2"><code class="plain"></</code><code class="keyword">head</code><code class="plain">></code></div><div class="line number10 index9 alt1"><code class="plain"><</code><code class="keyword">body</code><code class="plain">></code></div><div class="line number11 index10 alt2"> </div><div class="line number12 index11 alt1"><code class="plain"><</code><code class="keyword">div</code> <code class="color1">id</code><code class="plain">=</code><code class="string">"radio"</code><code class="plain">></code></div><div class="line number13 index12 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">input</code> <code class="color1">type</code><code class="plain">=</code><code class="string">"radio"</code> <code class="color1">id</code><code class="plain">=</code><code class="string">"radio1"</code> <code class="color1">name</code><code class="plain">=</code><code class="string">"radio"</code><code class="plain">><</code><code class="keyword">label</code> <code class="color1">for</code><code class="plain">=</code><code class="string">"radio1"</code><code class="plain">>Choice 1</</code><code class="keyword">label</code><code class="plain">></code></div><div class="line number14 index13 alt1"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">input</code> <code class="color1">type</code><code class="plain">=</code><code class="string">"radio"</code> <code class="color1">id</code><code class="plain">=</code><code class="string">"radio2"</code> <code class="color1">name</code><code class="plain">=</code><code class="string">"radio"</code> <code class="color1">checked</code><code class="plain">=</code><code class="string">"checked"</code><code class="plain">><</code><code class="keyword">label</code> <code class="color1">for</code><code class="plain">=</code><code class="string">"radio2"</code><code class="plain">>Choice 2</</code><code class="keyword">label</code><code class="plain">></code></div><div class="line number15 index14 alt2"><code class="undefined spaces"> </code><code class="plain"><</code><code class="keyword">input</code> <code class="color1">type</code><code class="plain">=</code><code class="string">"radio"</code> <code class="color1">id</code><code class="plain">=</code><code class="string">"radio3"</code> <code class="color1">name</code><code class="plain">=</code><code class="string">"radio"</code><code class="plain">><</code><code class="keyword">label</code> <code class="color1">for</code><code class="plain">=</code><code class="string">"radio3"</code><code class="plain">>Choice 3</</code><code class="keyword">label</code><code class="plain">></code></div><div class="line number16 index15 alt1"><code class="plain"></</code><code class="keyword">div</code><code class="plain">></code></div><div class="line number17 index16 alt2"> </div><div class="line number18 index17 alt1"><code class="plain"><</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number19 index18 alt2"><code class="plain">$( "#radio" ).buttonset();</code></div><div class="line number20 index19 alt1"><code class="plain"></</code><code class="keyword">script</code><code class="plain">></code></div><div class="line number21 index20 alt2"> </div><div class="line number22 index21 alt1"><code class="plain"></</code><code class="keyword">body</code><code class="plain">></code></div><div class="line number23 index22 alt2"><code class="plain"></</code><code class="keyword">html</code><code class="plain">></code></div></div></td></tr></tbody></table></div>
|
|
<h4>Demo:</h4>
|
|
<div class="demo code-demo" data-height="100"></div>
|
|
</div></section>
|
|
</div></article>
|
|
|
|
</body>
|
|
</html>
|