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

273
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 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