【发布时间】:2016-03-13 15:32:06
【问题描述】:
我希望在模式窗口关闭时,在显示模式窗口中播放的视频停止播放(谁不会?)。这很容易通过 jQuery 将 iframe 源设置为空来完成。
但我不知道如何让它在回调中工作。模态窗口本身按预期运行。这有效:
$('.close-button', '#video-reveal').on('click', function() {
$('#video-player').attr("src", "");
console.log("button event fired");
});
但是,以下都没有任何效果:
// from documentation
$(document).on('close.fndtn.reveal', '[data-reveal]', function() {
var modal = $(this);
console.log("closing reveal event fired");
});
// my attempt to do it programmatically
$('[data-reveal]').on ('opened.fndtn.reveal', function() {
var modal = jQuery(this);
console.log("opened reveal");
});
所以感觉事件没有触发。我确定是,但是如何捕获呢?
【问题讨论】:
标签: zurb-foundation-6 zurb-reveal