我正在通过 Quicktime 在 jQuery 对话框中通过下面的代码播放音频文件。一切正常,但我想做的是当我关闭对话框时,我希望音频文件也停止。实际上它一直在玩。
代码:
//Listen Music
$('.listenMusic').live('click', function(){
if($('div.ui-dialog').length){
$('div.ui-dialog').remove();
}
var path = $(this).attr('rel');
var $dialog = $('<div>', {
title: Listen
}).dialog({
autoOpen: false,
modal: true,
width: 400,
height: 100
});
var tab = '<table width="90%" style="margin: 10px 10%;"><tr><td><object codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><param value="'+path+'" name="SRC"><param value="true" name="AUTOPLAY"><param value="true" name="CONTROLLER"><embed pluginspage="http://www.apple.com/quicktime/download/" controller="true" style="height:20px;width:300px;background-color:#D9EBFB" autoplay="true" target="myself" src="'+path+'"></object></td></tr></table>';
$('<div id="updateContent">').html(tab).appendTo($dialog);
$dialog.dialog('open');
return false;
});
这是我在上面代码中使用的标签
<object codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><param value="'+path+'"
name="SRC"><param value="true" name="AUTOPLAY"><param value="true"
name="CONTROLLER"><embed pluginspage="http://www.apple.com/quicktime/download/"
controller="true" style="height:20px;width:300px;background-color:#D9EBFB"
autoplay="true" target="myself" src="'+path+'"></object>