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

175
Vistas
Foundation fire event on modal close?

I'm using foundation reveals within my application to send information via AJAX. Everything is working but upon the modal closing I want to change some text. How do you fire a function when a modal closes with Foundation 6? Any help would be great, my current code is as follows:

$("#share_modal").foundation('reveal', 'close', function() {
    alert("closed");
});

I'm getting the error

Uncaught ReferenceError: We're sorry, 'reveal' is not an available method for this element.

But the element I'm referring to is the .reveal

<div class="reveal" id="share_modal" data-reveal data-options="closeOnClick:true; closeOnEsc: true;">
    <div class="row">
about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

With Foundation 6, the events are a little different.

(function ($, window, undefined) {
  'use strict';

  $('[data-reveal]').on('closed.zf.reveal', function () {
    var modal = $(this);
    alert('closed');
  });

  $(document).foundation();


})(jQuery, this);

That will target all reveals. If you want to target just #share_modal change the selector from $('[data-reveal]') to $('#share_modal') or you can use modal.id to check the element id. It may be modal.attr('id')

Reference: http://foundation.zurb.com/sites/docs/reveal.html#js-events

about 4 years ago · Santiago Trujillo Denunciar

0

Foundation 5

$(document).on('close.fndtn.reveal', '[data-reveal]', function () {
     alert('closed!!!');
});
about 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