그래서 기본적으로 나는 팝업 팝업을 팝업 팝업으로 가지고있다. 그 안에는 YouTube 비디오 플레이어가 있습니다. 모든 것은 작동합니다. 창을 닫을 때까지 배경 음악이 들리면 여전히 비디오가 재생 중입니다. 나는 그것을 멈추고 싶다. 나는 약간의 연구를했고 유튜브 API에 떨어졌지만, 여전히 작동하지 않습니다.팝업창의 유튜브 비디오가 창을 닫을 때 멈추지 않는다
여기 사업부
echo "<div id='popupContact'>";
echo "<a id='popupContactClose'>x</a>";
echo "<div><h1>" .$row['title']. "</h1></div>";
echo "<p id='contactArea'>";
if($row[type] == "image")
echo "<img src='gallery/" .$row['path']. "' alt='" .$row['title']. "'/>";
else
echo "<iframe width='560' height='315' src='http://www.youtube.com/v/" .$row['path']."? enablejsapi=1&version=3&playerapiid=ytplayer' frameborder='0' allowfullscreen></iframe>";
echo "<br/><br/>" .$row['description']. "</p>";
echo "</div>";
echo "<div id='backgroundPopup'></div>";
내 코드입니다 그리고 여기 팝업에 대한 코드입니다 :
//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
//LOADING POPUP
//Click the button event!
$("#button").click(function(){
//centering with css
centerPopup();
//load popup
loadPopup();
});
//CLOSING POPUP
//Click the x event!
$("#popupContactClose").click(function(){
disablePopup();
});
//Click out event!
$("#backgroundPopup").click(function(){
disablePopup();
});
//Press Escape event!
$(document).keypress(function(e){
if(e.keyCode==27 && popupStatus==1){
disablePopup();
}
});
});
//disabling popup with jQuery magic!
function disablePopup(){
//disables popup only if it is enabled
if(popupStatus==1){
$("#backgroundPopup").fadeOut("slow");
$("#popupContact").fadeOut("slow");
popupStatus = 0;
stop();
}
}
function onYouTubePlayerReady(playerId) {
alert("YAY");
ytplayer = document.getElementById("ytplayer");
}
function stop() {
if (ytplayer) {
ytplayer.stopVideo();
}
}
감사합니다, 아라
나는() { \t //로드는 팝업 있습니다 .. #button 클릭 할 때 호출되는') (기능'loadPopup에 대한 – jmm
기능 loadPopup를 코드를 볼 수 없습니다 \t 경우 (. popupStatus == 0) { \t \t $ ("#의 backgroundPopup") CSS ({ \t \t \t "불투명" "0.7" \t \t}); \t \t $ ("# backgroundPopup") .fadeIn ("slow"); \t \t $ ("# popupContact") .fadeIn ("slow"); \t \t popupStatus = 1; \t} } – user1049769
내 답변에 나열된 설명서를 검토 했습니까? – jmm