asp.net站点中的全屏div元素

时间:2015-02-20 11:50:46

标签: javascript html asp.net-mvc internet-explorer html5-fullscreen

我有一个带媒体库的HTML文档:

<div class="videoTabClass" id="videoTab">
    <div id="videoGalleryTEST">
        <video controls="controls" preload="metadata" class="media-content" style="height: 150px;" title="" src="test.mp4"></video>
        <button onclick="makeFullScreen">
            Fullscreen
        </button>
    </div>
</div>

按钮有一个功能:

 function makeFullScreen(evt) {
     var testFullScreen = document.getElementById("videoGallery");
     var divObj = document.getElementById("videoGallery");

     if (divObj.requestFullscreen)   
       if (document.fullScreenElement) {
         document.exitFullscreen();       
       } else {
         divObj.requestFullscreen();
       }
     else if (divObj.msRequestFullscreen)**//true in simple *.html but undefined in asp.net**
       if (document.msFullscreenElement) {
         document.msExitFullscreen();
       } else {
        divObj.msRequestFullscreen();
       }
     else if (divObj.webkitRequestFullscreen)
       if (document.webkitFullscreenElement) {
         document.webkitCancelFullScreen();
       } else {
         divObj.webkitRequestFullscreen();
       }
    }

当我在简单的html文件中调试此代码时,一切正常。我的视频库在所有浏览器中全屏显示。当我在ASP.NET站点中调试此函数时,问题出现了。在Chrome和Mozilla浏览器中它仍然可以,但在IE-11中没有指定div元素的msRequestFullscreen()函数,它只是未定义。 asp.net如何影响html元素?

0 个答案:

没有答案