Trigger function start only when scrolling down? #581
              
                
                  
                  
                    Answered
                  
                  by
                    thebuilder
                  
              
          
                  
                    
                      jackytam2020
                    
                  
                
                  asked this question in
                Q&A
              
            -
| Currently have it setup as this: I want the div to take on the classname of "line-in-view" but only when I'm scrolling down to the div until its in view. I don't want it to do anything when I'm scrolling back up. | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            thebuilder
          
      
      
        Sep 14, 2022 
      
    
    Replies: 1 comment
-
| You'd want to combine this with another hook that tracks scroll direction (e.g. a  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        jackytam2020
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
You'd want to combine this with another hook that tracks scroll direction (e.g. a
useEffectthat monitorsscroll), and see what the last scroll direction was when theinViewchanges.