Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. onWheel = e => {
  2. if (e.deltaY > 0) {
  3. this.props.history.push('/work');
  4. }
  5. };
  6.  
  7. componentDidMount() {
  8. setTimeout(() => {
  9. window.addEventListener('wheel', this.onWheel);
  10. }, 500);
  11. }
  12.  
  13. componentWillUnmount() {
  14. window.addEventListener('wheel', this.onWheel);
  15. }
  16.  
  17. onWheel = e => {
  18. if (e.deltaY < 0) {
  19. this.props.history.push('/');
  20. }
  21. if (e.deltaY > 0) {
  22. this.props.history.push('/about');
  23. }
  24. }
  25.  
  26. componentDidMount() {
  27. setTimeout(() => {
  28. window.addEventListener('wheel', this.onWheel);
  29. }, 500);
  30. }
  31.  
  32. componentWillUnmount() {
  33. window.addEventListener('wheel', this.onWheel);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement