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;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章