赞
踩
- /**
- * 浏览器判断是否全屏
- */
- export const fullscreenToggel = () => {
- if (fullscreenEnable()) {
- exitFullScreen();
- } else {
- reqFullScreen();
- }
- };
- /**
- * esc监听全屏
- */
- export const listenfullscreen = (callback) => {
- function listen () {
- callback()
- }
- document.addEventListener("fullscreenchange", function () {
- listen();
- });
- document.addEventListener("mozfullscreenchange", function () {
- listen();
- });
- document.addEventListener("webkitfullscreenchange", function () {
- listen();
- });
- document.addEventListener("msfullscreenchange", function () {
- listen();
- });
- };
- /**
- * 浏览器判断是否全屏
- */
- export const fullscreenEnable = () => {
- var isFullscreen = document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen
- return isFullscreen;
- }
-
- /**
- * 浏览器全屏
- */
- export const reqFullScreen = () => {
- if (document.documentElement.reques
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。