Menu icon Foundation
Reveal Modal - 'Opened' callback issue

$(document).on('opened.fndtn.reveal', '[data-reveal]', function () {
  alert('open function triggered!')
});

Hi there,

For some reason, the 'opened' callback fires 2 times for reveal models. Is there any work around for this?

Thank You.

reveal modal

$(document).on('opened.fndtn.reveal', '[data-reveal]', function () {
  alert('open function triggered!')
});

Hi there,

For some reason, the 'opened' callback fires 2 times for reveal models. Is there any work around for this?

Thank You.

Dominik Scholz about 5 years ago

This is a bug. There are two events: "opened.fndtn.reveal" and "opened", latter of them is still present for legacy reasons, but causes the event to be fired twice, if you use the new prefixed event. Simply use the older "opened" event and you are good to go.

I think the next major release (i.e. Foundation 5.4) will include a fix for this, when it comes out, as it will remove those deprecated events listeners - but remember to adjust your script after updating to v5.4.

This bug has already been mentioned here:
http://foundation.zurb.com/forum/posts/16390-reveal---firing-callback

Kind regards
Dominik

Vipin J S about 5 years ago

Thanks Dominik. :)

l3x about 4 years ago

Its an old post but maybe it will be useful for someone

http://foundation.zurb.com/forum/posts/26190