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

134
Visualizações
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 à 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