02.06.2015 Views

Bootstrap Tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Usage<br />

You can enable buttons plugin via JavaScript as below:<br />

$('.btn').button()<br />

Options<br />

No options<br />

Methods<br />

The following are some useful methods for buttons plugin:<br />

Method Description Example<br />

button('toggle')<br />

.button('loading')<br />

.button('reset')<br />

.button(string)<br />

EXAMPLE<br />

Toggles push state. Gives the button the appearance that it has<br />

been activated. You can also enable auto toggling of a button by<br />

using thedata-toggle attribute.<br />

When loading, the button is disabled and the text is changed to<br />

the option from the data-loading-textattribute of button element<br />

Resets button state, bringing the original content back to the<br />

text. This method is useful when you need to return the button<br />

back to the primary state<br />

String in this method is referring to any string declared by the<br />

user.To reset the button state and bring in new content use this<br />

method.<br />

$().button('toggle')<br />

$().button('loading')<br />

$().button('reset')<br />

$().button(string)<br />

The following example demonstrates use of above methods:<br />

Click on each of the buttons to see the effects of methods<br />

Example to demonstrate .button('toggle') method<br />

<br />

Primary<br />

<br />

Example to demonstrate .button('loading') method<br />

<br />

Primary<br />

<br />

<br />

TUTORIALS POINT<br />

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!