transition 与 不固定高度模块 实现过渡

transition 与 不固定高度模块 实现过渡

transtion与不固定高度实现过渡
只需要这只max-Height就可以

如下react代码

<div className={`skuListBox ${this.state.hover?'maxHeight800':'maxHeight0'}`} onMouseEnter={this.mouseEnter.bind(this)} onMouseLeave={this.mouseLeave.bind(this)}>
    高度变化
</div>
// onMouseEnter/onMouseLeave 方法用来改变hover的值
onMouseEnter = () => {
	this.setState({hover:true});
};
onMouseLeave = () => {
	this.setState({hover:false});
};
.maxHeight800{
    max-height: 800px!important;
}
.maxHeight0{
    max-height: 0!important;
}
发布了6 篇原创文章 · 获赞 3 · 访问量 4914

猜你喜欢

转载自blog.csdn.net/qq_39882537/article/details/102499838