aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/animate/default.html11
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>