Skip to content
Permalink
Browse files

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

  • Loading branch information...
scottgonzalez committed May 21, 2012
1 parent 820cff8 commit 1da4d7e18d9a4393ab49b3e603278247af614a2b
Showing with 6 additions and 5 deletions.
  1. +6 −5 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>

0 comments on commit 1da4d7e

Please sign in to comment.
You can’t perform that action at this time.