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

169
Visualizações
How do I programmatically close an open jquery.reveal.js modal box?

I am using the Reveal jQuery plugin. http://www.zurb.com/playground/reveal-modal-plugin

I need to programmatically close the model box when I am done with it, however that feature is not including directly with the plugin.

According to Dave in the comments page,

"The code is in there, just need to hook it up to be called programmatically."

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

If your modal's id is 'reveal-modal', then just this line will do it:

$('#reveal-modal').trigger('reveal:close');
over 4 years ago · Santiago Trujillo Relatório

0

You can do it a couple of ways.

Trigger a click via jquery on the dismissmodalclass element (defaults to 'close-reveal-modal')

 $('.close-reveal-modal').click();

OR

Add this to reveal.js

$.fn.hideModal = function(options){
  var self        = this,
      modal       = $(self),
      topMeasure  = parseInt(modal.css('top'));
  $('.reveal-modal-bg').css({'display' : 'none'});      
  modal.css({'visibility' : 'hidden', 'top' : topMeasure});
}

and use

$('#your_modal_box').hideModal()
over 4 years ago · Santiago Trujillo Relatório

0

The modals class is usually 'reveal-modal'. so changing the lookup to be class based rather than id based, makes this work for more cases:

$('.reveal-modal').trigger('reveal:close');
over 4 years ago · Santiago Trujillo 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