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

139
Vistas
my Modal is stick to the bottom, however I want it in the center of the page

Please click here to see the screensot of my Modal

my Modal is stick to the bottom, however I want it in the center of the page... the following code my Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following codemy Modal is stick to the bottom, however I want it in the center of the page... the following code

This is my JS for the modal

const modalLinkElements = document.querySelectorAll('.info-modal');


let infoModal;

function toggleBackdrop() {
  backdropElement.classList.toggle('visible');
}

function presentInfoModal(event) {
  const bookId = parseInt(event.target.dataset.text);
  toggleBackdrop();

  infoModal = document.createElement('div');
  infoModal.classList.add('modal');
  allArtAndDesignBooks.forEach((product) => {
      if (product.id===bookId)
      {
          infoModal.innerHTML = `

          <h2>${product.name}</h2>
          <div class="container-fluid">
              <div class=""row">
                  <div class="col-sm-4">
                       
                               <img src="${product.imgSrc}" />
                          
                      </div>
                  <div class="col-sm-8">

                       <p>${product.description}</p>   
                  </div>
              </div>
            </div>

          
`;
      }
   
  })
  const closeButton = document.createElement('button');
  closeButton.addEventListener('click', hideInfoModal);
  closeButton.textContent = 'Okay';
  infoModal.appendChild(closeButton);
  document.body.appendChild(infoModal);
}

function hideInfoModal() {
  toggleBackdrop();
  document.body.removeChild(infoModal);
}

backdropElement.addEventListener('click', hideInfoModal);

for (const linkElement of modalLinkElements) {
  linkElement.addEventListener('click', presentInfoModal);
}

** and this is my css for modal**

.modal {
  position: fixed;
  top: 20vh;
  bottom: 10vh;
  left: 5%;
  width: 90%;
  z-index: 100;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  animation: float-in 0.3s ease-out forwards;
  display: flex;
  flex-direction: column;
  overflow:hidden;
  overflow-y:scroll;
  vertical-align:middle;
}

** i dont have much to write detail for this post **

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