1.less实现:transition-timing-function:贝塞尔斜率曲线运动
*{
margin: 0;
padding: 0;
height: 100%;
body{
width: 60%;
height: 75%;
border: 1px solid;
//margin:上左右下
margin: 15% auto 0;
&:hover #wrap{
/**
如果暴露的为2个property
1.先根据hover的property重新定义transition,进行渲染height和font
2.在移出#wrap后,再次调用已定义的proterty,进行渲染background和width
*/
transition-property: height,font;
height: 100px;
font: 20px/100px "微软雅黑";
background: salmon;
width: 100px;
}
#createDiv{
height: 800px;
position: relative;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
transition-property: height;
transition-duration: 2s;
transition-timing-function: cubic-belizer(.12,1.36,.65,-0.28);
}
#wrap{
width: 300px;
height: 300px;
font: 50px/300px "微软雅黑";
text-align: center;
background: aquamarine;
border-radius: 50%;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
transition-property: background,width;
transition-duration: 4s,3s;
//cubic-bezier: 函数中定义值。可能的值是 0 至 1 之间的数值(开始时间值,开始峰值,结束时间值,结束峰值)
transition-timing-function: cubic-belizer(.12,1.36,.65,-0.28);
}
}
}
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657