0

我正在尝试在弹出窗口中显示视频,单击图像时会弹出该视频。当我尝试关闭弹出窗口时,右上角的“X 按钮”会关闭并且不会再次打开,但会在后台播放音频。代码如下:

<script>
    function CreatePopup() {
    //create a div for the popup
    var $popUp = $("<div/>").popup({
    id : "pop1",
    dismissible : false,
    theme : "a",
    overlyaTheme : "a",
    transition : "pop",
    position : "origin"
    });

    //create a title for the popup
    $("<h2/>", {
    text : "Video Feed"
    }).appendTo($popUp);
    $("<a/>", {
    id : "cls",
    href : "#",
    "data-rel" : "back",
    "data-role" : "button",
    "data-theme" : "a",
    "data-icon" : "delete",
    "data-iconpos" : "notext",
    "data-transition" : "flip",
    "class" : "ui-btn-right",
    text : "Close"
    }).appendTo($popUp).bind("click", (function() {
    RemovePopup();
    }));
    $("<iframe/>", {
    id : "ifr",
    src : "media/sap.mp4",
    width : "200px",
    height : "200px"
    }).appendTo($popUp);
    $popUp.popup("open").trigger("create");
    }
    function RemovePopup() {

    //$("#ifr").remove();
        $("#pop1").empty();
    $("#pop1").popup("close");

    }

    $(function() {
        $("#img1").click(function() {
        CreatePopup();
            });
    });
</script>

HTML如下:

<body>
    <div>
        <img src="images/supermarket.jpg" style="width: 600; height: 500; float: left; display: inline; margin-left: 200px;">

        <a id="g1c1" href="#pop1" style="position: absolute;top:191px;left:334.28125px;" data-rel="popup" data-inline="true" data-transition="popup" data-mini="true"> <img id="img1" src="images/cctvcam.jpg"> </a>
    </div>

</body>

请帮我找到解决办法。

4

0 回答 0