react bootstrap navbar fade out

Solutions on MaxInterview for react bootstrap navbar fade out by the best coders in the world

showing results for - "react bootstrap navbar fade out"
Paul
28 Jun 2018
1render(){
2   const opacity = Math.min(100 / this.state.currentScrollHeight  , 1)
3
4    return <div style={{opacity}} id='element-you-want-to-fade'> </div>
5}
Lautaro
26 Sep 2019
1componentDidMount () {      
2   window.onscroll =()=>{
3    const newScrollHeight = Math.ceil(window.scrollY / 50) *50;
4    if (this.state.currentScrollHeight != newScrollHeight){
5        this.setState({currentScrollHeight: newScrollHeight})
6    }
7  }
8}