Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
Ajax load causes content to jump

When I am loading in content from another page using Ajax my footer jumps up to below my header before moving back down.

I recon this is caused by $('#container').remove(); which means I am essentially removing the container before loading in the new container.

Is there a way to stop my footer from jumping up and down between Ajax loads?

Here is my JQuery

$('nav a').on('click', function(e) {
   e.preventDefault();
   var url = this.href;
   $('nav a.highlight').removeClass('highlight');
   $(this).addClass('highlight');
   $('#container').remove();
   $('#content').load(url + ' #container').hide().fadeIn(3500);
});

I'v uploaded an example of what is happening to me on a test server here.
I had to upload it as a snippet or pen does not allow more than one HTML page

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Do not remove #container

$('nav a').on('click', function(e) {
  e.preventDefault();
  var url = this.href;

  $('nav a.highlight').removeClass('highlight');
  $(this).addClass('highlight');

  //$('#container').remove();
  $('#content').load(url + ' #container').hide().fadeIn(3500);
});
about 4 years ago · Santiago Trujillo Denunciar

0

I'm not perfect but i think this can help you to get an idea. You can set min-height of #content or you can add a class .stick_footer to footer immediately after removing container and remove class .stick_footer after data loaded. sorry for bad english.

.stick_footer{
  position:absolute; bottom:0;left:0;right:0; top:9em;
}
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda