jquery实现动画效果,放大淡化消失

<!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>

猜你喜欢

转载自blog.csdn.net/qq_37828633/article/details/80226308