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

85
Vistas
How to stop Javascript div opening from moving the contents around

Is there a way to stop the content of my div from moving around as it opens and closes? It looks really messy. When you click to open the div everything goes from one line to two lines to 3 lines etc. I just want it to open as it will display when fully open. I have included some screenshots to show what I mean.

This image showcases what the div looks like as it opens with everything stacked on top of each other.

enter image description here

This is the final result with everything where it should be, ideally I would like the div to open with everything staying as below.

enter image description here

This is the code I have:

<script>
function openNav() {
            var sidenav = document.getElementById("mySidenav");
            sidenav.classList.add("sidenavopen");
            sidenav.classList.remove("sidenavclose");
        }
        function closeNav() {
            var sidenav = document.getElementById("mySidenav");
            sidenav.classList.add("sidenavclose");
            sidenav.classList.remove("sidenavopen");
        }
</script>



<style>    
.sidenav .closebtn {
      position: absolute;
      top: 0px;
      left: 25px;
      font-size: 36px;
      margin-left: 50px;
    }
    
    @media screen and (max-height: 450px) {
      .sidenav {padding-top: 15px;}
      .sidenav a {font-size: 18px;}
    }
    
    .sidenavopen {
      width: 40%;
      @media (max-width: $breakpoint-mobile) {
        width: 100%;
      }
    }
    .sidenavclose {
      width: 0 !important;
    }
</style>
about 4 years ago · Juan Pablo Isaza
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