const footerContentContainer = this.refs.footerContentContainer,
howContainer = this.refs.howContainer;
const footerContentContainerHeight = footerContentContainer.scrollHeight;
const howContainerPositionTop = howContainer.offsetTop;
footerContentContainer.style.height = this.state.isActive ? 0 : footerContentContainerHeight;
if(!this.state.isActive && howContainerPositionTop > 0) document.body.scrollTop = howContainerPositionTop;
当前要实现一个效果,一开始footerContentContainer
height为0,置为不为0之后,body的scrollTop也跟着变化,当前body的scrollTop变化时很生硬,我应该加上footerContentContainer
的css样式里面加上 transition: height 0.5s
。但是有了过渡效果,howContainerPositionTop
获取的值偶尔不一样。
我改如何去修改这个过渡效果
加个倒计时,逐一递减