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

230
Visualizações
Deshabilitar el desplazamiento en el precargador

¿Hay alguna forma de deshabilitar el desplazamiento del usuario si el precargador está activo? Entonces, para deshabilitar el desplazamiento del cuerpo.

Sería increíble si pudieras ayudarme.

Aquí está mi código de cajero automático:

 <div id="preloader"></div> #preloader{ background: #000 url(images/preloader.gif) no-repeat center center ; background-size: 15%; height: 100%; width: 100vw; z-index: 100000; position: fixed; } var loader = document.getElementById("preloader"); window.addEventListener("load", function(){ loader.style.display = "none"; })
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Si necesita deshabilitar el desplazamiento de página completa, puede configurar el overflow: hidden en el cuerpo y luego regresarlo una vez que se complete la carga

about 4 years ago · Juan Pablo Isaza Relatório

0

No creo que técnicamente puedas deshabilitar/cancelar el desplazamiento, pero podrías intentar cambiar cómo actuará el scroll .

Aquí hay un ejemplo que hice que podría evitar que se desplace cuando el usuario hace clic en el button y el preloader se activa.

 var loader = document.getElementById("preloader"); window.addEventListener("load", function(){ window.onscroll = function(){window.scrollTo(0,0)}; })
 #preloader{ /* background: #000 url(images/preloader.gif) no-repeat center center ;*/ background-size: 15%; width:200px z-index: 100000; position: fixed; }
 <div id="preloader">Stack Overflow is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network,[4][5][6] created in 2008 by Jeff Atwood and Joel Spolsky.[7][8] It features questions and answers on a wide range of topics in computer programming.[9][10][11] It was created to be a more open alternative to earlier question and answer websites such as Experts-Exchange. Stack Overflow was sold to Prosus, a Netherlands-based consumer internet conglomerate, on 2 June 2021 for $1.8 billion.[12] The website serves as a platform for users to ask and answer questions, and, through membership and active participation, to vote questions and answers up or down similar to Reddit and edit questions and answers in a fashion similar to a wiki.[13] Users of Stack Overflow can earn reputation points and "badges"; for example, a person is awarded 10 reputation points for receiving an "up" vote on a question or an answer to a question,[14] and can receive badges for their valued contributions,[15] which represents a gamification of the traditional Q&A website. Users unlock new privileges with an increase in reputation like the ability to vote, comment, and even edit other people's posts.[16] As of March 2021 Stack Overflow has over 14 million registered users,[17] and has received over 21 million questions and 31 million answers.[18] Based on the type of tags assigned to questions, the top eight most discussed topics on the site are: JavaScript, Java, C#, PHP, Android, Python, jQuery, and HTML.[19] Stack Overflow also has a Jobs section to assist developers in finding their next opportunity.[20] For employers, Stack Overflow provides tools to brand their business, advertise their openings on the site, and source candidates from Stack Overflow's database of developers who are open to being contacted</div>

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