mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Animate demo: Don't use .toggle(fn).
This commit is contained in:
parent
820cff8a67
commit
1da4d7e18d
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user