diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-05-21 10:06:46 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-05-21 10:06:46 -0400 |
commit | 1da4d7e18d9a4393ab49b3e603278247af614a2b (patch) | |
tree | c7ab2f53d42cc4f73d77f505a3e09569c98fa7a3 /demos/animate | |
parent | 820cff8a67d96c07f3e5394fd49055bbcf7cb939 (diff) | |
download | jquery-ui-1da4d7e18d9a4393ab49b3e603278247af614a2b.tar.gz jquery-ui-1da4d7e18d9a4393ab49b3e603278247af614a2b.zip |
Animate demo: Don't use .toggle(fn).
Diffstat (limited to 'demos/animate')
-rw-r--r-- | demos/animate/default.html | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/demos/animate/default.html b/demos/animate/default.html index 4fec428e7..307d030a6 100644 --- a/demos/animate/default.html +++ b/demos/animate/default.html @@ -15,22 +15,23 @@ </style> <script> $(function() { - $( "#button" ).toggle( - function() { + var state = true; + $( "#button" ).click(function() { + if ( state ) { $( "#effect" ).animate({ backgroundColor: "#aa0000", color: "#fff", width: 500 }, 1000 ); - }, - function() { + } else { $( "#effect" ).animate({ backgroundColor: "#fff", color: "#000", width: 240 }, 1000 ); } - ); + state = !state; + }); }); </script> </head> |