<!DOCTYPE html>
<
html
lang=
"en">
<
head>
<
meta
charset=
"UTF-8">
<
meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0">
<
meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge">
<
title>Document</
title>
<
script
src=
"https://code.jquery.com/jquery-1.10.2.js"></
script>
<
style>
#tri{
width:
50
px;
height:
50
px;
background-color:
red
}
</
style>
</
head>
<
body>
<
div
id=
"tri">
</
div>
<
button
id=
"btn"
onclick=
"donghua()">动画</
button>
<
script>
var
donghua
=
function(){
$(
"#tri").
animate(
{
width:
'500px',
height:
'500px'
},
1500,
function(){
$(
this).
fadeOut(
"slow");
}
)
}
</
script>
</
body>
</
html>