2012-07-23 41 views
0

我在jQuery模态窗口中有一个jPlayer实例。除了这个事实,当我关闭窗口时,玩家一直玩游戏。我能够捕捉窗口的关闭事件,但由于某种原因,不是玩家本身。任何帮助将不胜感激。下面是我的一些代码:jPlayer在模态窗口中的实例在关闭时不会停止

//Modal Dialog 
$(function() { 
    var dHeight = $("#dialog-modal").data("mdheight"), 
     dWidth = $("#dialog-modal").data("mdwidth"); 
    $("#dialog-modal").dialog({ 
     autoOpen: false, 
     height: dHeight, 
     width: dWidth, 
     resizable: false, 
     modal: true 
    }); 
    $("#modal-opener").click(function() { 
     $("#dialog-modal").dialog("open"); 
     return false; 
    }); 
    //Capture dialog closing 
    $("#dialog-modal").live("dialogclose", function (event) { 
     $("#jquery_jplayer_1'").jPlayer("destroy"); 
    }); 
}); 

$(document).ready(function() { 
    new jPlayerPlaylist({ 
     jPlayer: "#jquery_jplayer_1", 
     cssSelectorAncestor: "#jp_container_1" 
    }, [{ 
     title: "Amazing Grace", 
     mp3: "AmazingGrace.mp3", 
     oga: "AmazingGrace.ogg" 
    } 
    }); 
+0

为什么不“之前,关闭对话框”使在停止活动 – manix 2012-07-25 01:38:49

回答