* {
margin:0;
padding:0
}
#msg {
width:200px;
height:200px;
position:fixed;
right:30px;
bottom:-200px;
background-color:LightBlue;
transition:all 2s linear;
}
#msg>a {
float:right;
padding:5px 10px;
border:1px solid black;
cursor:pointer;
}
首先要在css中为msg添加transition属性,
然后获得id为msg的div,为msg下的a绑定单击事件,
利用定时器,改变元素的高度,从而实现效果