<script src="/wp-content/uploads/2015/02/screenfull.js"></script>
<button id="btn_full_scr">全屏测试按钮</button>
<script>// <![CDATA[
jQuery(function() {
jQuery('#btn_full_scr').click(function() {
if (!screenfull.enabled) {
alert('你的浏览器不支持全屏');
}
screenfull.request();
// does not require jQuery, can be used like this too:
//screenfull.request(document.getElementById('container'));
});
});
// ]]></script>
tips:
本文由wp2Blog导入,原文链接:http://devonios.com/page-screenfull-js.html