Skip to content

wenhe114/el-full

Repository files navigation

🍔dom节点全屏

在线演示

🚀 演示

安装

npm i el-full

快速开始

import {beFull} from 'be-full';

// 整个网页全屏显示
beFull();

// 指定元素全屏
beFull(document.getElementById('video'));

🔥更多API(4个函数)

exitFull(退出全屏)

exitFull();

toggleFull(切换全屏/退出)

使用方法同beFull, 只是第二次点击会执行exitFull

toggleFull();

// 切换指定元素全屏/退出
toggleFull(document.getElementById('video'));

isFull(元素是否全屏)

isFull(document.getElementById('video'));

watchFull(监视元素全屏状态变化)

const {cancel} = watchFull(document.documentElement, ev => {
    // 全屏状态变化执行         
});

// 取消监听
cancel();

About

全屏切换

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published