Spinner demo: Don't use .toggle(fn).

This commit is contained in:
Scott González 2012-05-21 10:02:57 -04:00
parent 5455b1599f
commit 33a91fb19e

View File

@ -14,16 +14,20 @@
<script>
$(function() {
var spinner = $( "#spinner" ).spinner();
$( "#disable" ).toggle(function() {
spinner.spinner( "disable" );
}, function() {
spinner.spinner( "enable" );
$( "#disable" ).click(function() {
if ( spinner.spinner( "option", "disabled" ) ) {
spinner.spinner( "enable" );
} else {
spinner.spinner( "disable" );
}
});
$( "#destroy" ).toggle(function() {
spinner.spinner( "destroy" );
}, function() {
spinner.spinner();
$( "#destroy" ).click(function() {
if ( spinner.data( "ui-spinner" ) ) {
spinner.spinner( "destroy" );
} else {
spinner.spinner();
}
});
$( "#getvalue" ).click(function() {
alert( spinner.spinner( "value" ) );