react中控制div的位置移动动画js⽂件
import React, { Component} from 'react';
import './compile.less';
class Compile extends Component {
constructor(props) {
super(props)
this.state = {
采购员面试
show: true
}
}
zoom=()=>{
this.tState({
show: this.state.show ? fal : true
})
}
render() {
return (
<div className={this.state.show ? 'show compile' : 'hide compile'}>
<div className="compile-title">历史记录</div>
<div className="compile-details"></div>
观后感500字 <div className="compile-copy"></div>
<div className="cut" onClick={}></div>
</div>
)
}
}
export default Compile
less⽂件
.compile{
position: relative;
top: -227px;
left: 80%;
z-index:2;
width:320px;
height:100%;
background:#e7e7e7;
.compile-title{
怎么包粽子
width:320px;
height:50px;
font-size: 16px;
color: #333333;
line-height:50px;
padding-left:12px;
background:#f0f0f0;
周北辰 border-bottom:1px solid #aaaaaa;
青春不留白
}
.compile-details{
width:320px;
height:382px;
background:#e7e7e7;
border-bottom:1px solid #cccccc;
}
说到做到 .compile-copy{
width:320px;
height:249px;
background:#e7e7e7;
}
.cut{
position: absolute;
top: 50%;
left: -11px;
}
}
.show {
animation: show-item .8s ea-in forwards; }
小说改编电视剧
.hide {
animation: hide-item .8s ea-in forwards; }
@keyframes show-item {
0% {
left: 100%;
}
100% {
left: 80%;
}
}
@keyframes hide-item {
0% {
left: 80%;
}
数学读本读后感
100% {
left: 100%;
}
}