全屏测试按钮
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 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>