search

Home  >  Q&A  >  body text

Implement vertical scrolling within a page that targets a specific section without moving the entire page

<p>I've seen this effect on some pages: you scroll down, but the page itself seems to be motionless. Therefore, some elements will fade in or out, appear or disappear. I have a section containing 5 cards. Now I want to create the same effect. When I scroll down to the section, I want to navigate the section by scrolling up and down. Depending on where I am currently, I want a card to be shown or hidden. </p> <p>I started by adding <code>overflow: scroll</code> to that section, but then I ran out of ideas to create this effect. </p>
P粉946437474P粉946437474462 days ago397

reply all(1)I'll reply

  • P粉739942405

    P粉7399424052023-08-16 15:02:43

    Use background-attachment:fixed; to set the background fixed for a specific part.

    reply
    0
  • Cancelreply