Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
How to scroll a section with full height with vue3

Let's say, I have two sections namely One and Two. Both of these section has a full-screen height and full-screen width(ignore the top navbar in the video). Now, when a user scrolls my page, I don't want my sections to be half scrolled. The window will either be the first section or the second. If the user scrolls down, he will see the 2nd section, and the 2nd section will always have full-screen height. Also, if the user scrolls up, he will see the first section, and the 1st section will take up the entire height of the 1st section. Finally, users can only scroll to the 1st section or 2nd section. They cannot sit in the middle. I don't know whether I was able to describe what I wanted. But Look at the following GIF:

enter image description here

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can do this in CSS with Scroll Snap:

  1. Apply scroll-snap-type: y mandatory; to the <html> and <body> elements to enable vertical snapping.
  2. Apply scroll-snap-align: start; to the page element to snap to the start of the page element.
html, body {
  scroll-snap-type: y mandatory; 1️⃣
}

.page {
  height: 100vh;
  width: 100vw;
  scroll-snap-align: start; 2️⃣
}

demo

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda