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

126
Visualizações
Horizontal Scroll Problem - No elements off

There is an unwanted horizontal scroll on my website and I can't figure out why. I have a simple header that uses display: flex, justify-content: center, marin-top: 5vh and a padding on the logo and the burger. Further down it has a title that does translate-x: 1em to 0em when loading from the right, a text that does the same from the left and an image that does it again from the right. Screenshot from my Webpage

Code:

// Loading animation
loading = document.querySelectorAll(".loading");

window.onload = function(element) {
  loading.forEach((link) => {
    link.classList.add("loaded");
  });
};
.title {
  opacity: 0;
  transform: translateX(-2em);
  transition: transform 3s 0.5s cubic-bezier(0, 1, 0.3, 1), opacity 0.3s 0.5s ease-out;
  will-change: transform, opacity;
}

.title.loaded {
  opacity: 1;
  transform: translateX(0em);
}

.text {
  opacity: 0;
  transform: translateX(-4em);
  transition: transform 4s cubic-bezier(0, 1, 0.3, 1), opacity 0.3s 0.5s ease-out;
  will-change: transform, opacity;
}

.text.loaded {
  opacity: 1;
  transform: translateX(0);
}

.hero-image {
  opacity: 0;
  transform: translateX(1em);
  transition: transform 1s 0.5s cubic-bezier(0, 1, 0.3, 1), opacity 0.1s 0.5s ease-out;
  will-change: transform, opacity;
}

.hero-image.loaded {
  transform: translateX(0em);
  opacity: 1;
}

.mobile-hero {
  opacity: 0;
  transform: translateX(1em);
  transition: transform 1s 0.5s cubic-bezier(0, 1, 0.3, 1), opacity 0.1s 0.5s ease-out;
  will-change: transform, opacity;
}

.mobile-hero.loaded {
  transform: translateX(0);
  opacity: 1;
}
<div class="mobile">
  <div>
    <h1 class="title loading">Michael Nussbaum</h1>
    <p class="text bottom loading">Zeit ist relativ, Zeit ist Geld</p>
  </div>
  <img src="img/daniel-portrait.png" class="mobile-hero loading" />
</div>

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

0

I'm not entirely sure if this is what you're after, but if you want to stop horizontal overflow on a page you should be able to use this code:

body {
  overflow-x: hidden;
}

I don't work with animated elements a lot, but I would imagine that the translateX is causing the unwanted scroll, which the overflow-x should help. Hope this helped :)

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