Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleScrollWithBar = (e) => {
- if(e.target.scrollHeight > e.target.offsetHeight){
- if(e.target.offsetHeight + e.target.scrollTop == e.target.scrollHeight){
- let scrolled = update(this.state.scrolled, {$merge: {isScrolled: false }});
- this.setState({scrolled});
- this.nextSection();
- }
- }
- };
- nextSection = () => {
- if(!this.state.scrolled.isScrolled){
- var nxtSection = this.state.heightScreen + 100;
- this.setState({ heightScreen: nxtSection });
- var newCss = document.createElement("style");
- newCss.type = "text/css";
- newCss.innerHTML = ".page-home { transform: translate3d(0px, -"+nxtSection+"vh, 0px); }";
- document.body.appendChild(newCss);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement