Nutritious Pancake Mountain
    Wondering what’s next for npm?Check out our public roadmap! »

    @6h/be-full
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.5 • Public • Published

    be-full

    NPM Version

    🍔 任意元素全屏显示, 支持PC/移动端, 不到1kb.

    在线演示

    🚀 演示

    安装

    npm i -S be-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();

    Install

    npm i @6h/be-full

    DownloadsWeekly Downloads

    2

    Version

    0.0.5

    License

    ISC

    Unpacked Size

    13.1 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar