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>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#button" ).toggle(
|
var state = true;
|
||||||
function() {
|
$( "#button" ).click(function() {
|
||||||
|
if ( state ) {
|
||||||
$( "#effect" ).animate({
|
$( "#effect" ).animate({
|
||||||
backgroundColor: "#aa0000",
|
backgroundColor: "#aa0000",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
width: 500
|
width: 500
|
||||||
}, 1000 );
|
}, 1000 );
|
||||||
},
|
} else {
|
||||||
function() {
|
|
||||||
$( "#effect" ).animate({
|
$( "#effect" ).animate({
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
color: "#000",
|
color: "#000",
|
||||||
width: 240
|
width: 240
|
||||||
}, 1000 );
|
}, 1000 );
|
||||||
}
|
}
|
||||||
);
|
state = !state;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user