视频结束后,Shadowbox不会关闭

时间:2013-11-03 17:53:51

标签: javascript html5 video shadowbox

我在HTML5视频结束后无法自动关闭影视箱窗口!

我做错了吗?请帮助!

<script type="text/javascript">
Shadowbox.init({
    // skip the automatic setup 
    skipSetup: true
});

window.onload = function() {
    // open ASA the window loads
    Shadowbox.open({
        content:    '<video width="576" height="324" autoplay id="trailer"> <source src="../media/trailer.mp4" type="video/mp4"> Your browser does not support the video tag. </video>',
        player:     "html",
        height:     329,
        width:      581
    });
    document.getElementById('trailer').addEventListener('ended',myHandler,false);
    function myHandler(e) {
        if(!e) { e = window.event; }
        Shadowbox.close(); 
};


    }</script>

0 个答案:

没有答案