2012-07-23 22 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

回答

相關問題