我正在使用引导模式弹出窗口来显示项目中附加的音频/视频。单击取消按钮时,模式应关闭并且音频应停止播放。这在 Chrome 中正常工作,但在 mozila 和 IE 中,当我单击取消模式时,模式会消失,但音频/视频继续播放。
这是模式弹出的 HAML 代码:
%a{ href: "#", class: "x", title: "Close", :'data-dismiss' => "modal" }
.diagRepeater
= swf_tag "StrobeMediaPlayback",
:width => '620',
:height => (attachment.media_content_type.split('/')[0] == 'audio' ? '65' : '340'),
:flashvars => { :urlIncludesFMSApplicationInstance => "true",
:src => URI.encode("#{request.protocol}#{request.host_with_port}" + attachment.media.url),
:playButtonOverlay => (attachment.media_content_type.split('/')[0] == 'audio' ? 'false' : 'true'),
:controlBarAutoHide => (attachment.media_content_type.split('/')[0] == 'audio' ? 'false' : 'true') },
:parameters => { :allowFullScreen => "true", :wmode => "direct", :allowScriptAccess => "always" }
这是 bootstrap.js 文件中的代码:
hide: function (e) {
e && e.preventDefault()
var that = this
alert(this.toString());
e = $.Event('hide')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
$('body').removeClass('modal-open')
escape.call(this)
this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) :
hideModal.call(this)
}