我正在尝试在弹出窗口中使用 html5 全屏 api,但我不断收到此错误:
Uncaught TypeError: Object #<HTMLElement> has no method 'webkitEnterFullScreen'
这是我的html:
<html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Negar - one</title>
<script type="text/javascript" src="/Negar/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/Negar/js/viewer.js"></script>
<style type="text/css">
#main-content{height: 100%; width: 100%; position: absolute;
-webkit-transition: -webkit-transform 1s ease-in;
-moz-transition: -moz-transform 1s ease-in;
-ms-transition: -ms-transform 1s ease-in;
transition: transform 1s ease-in;
}
</style>
</head><link rel="stylesheet" type="text/css" href="data:text/css,">
<body>
<section id="main-content"> some code here </section>
</body></html>
这是我的功能:
$("#main-content").get(0).webkitEnterFullScreen();