Nascent Personality Manifestation

    jsfullscreen

    0.1.0 • Public • Published

    jsFullscreen

    NPM Version NPM Downloads License

    WHATWG Fullscreen API Fallback

    Demo

    Specification

    Fullscreen API, WHATWG

    Usage

    I suggest you to use jspm as your package manager.

    import Fullscreen from "jsfullscreen";
     
    const fullscreen = new Fullscreen(document.body);
     
    fullscreen.on("change", (isActive) => {
      console.log(`fullscreen is ${isActive ? 'active' : 'not active'}`);
    });
     
    fullscreen.element.addEventListener("click", () => {
      fullscreen.requestFullscreen();
    });

    Directly in a browser

    Please checkout the index-dist.html file for direct usage in a browser.

    API

    Classes

    • Fullscreen
      • Constructor(Element element) extends EventEmitter
      • Members
        • requestFullscreen() => Promise
      • Static Members
        • exitFullscreen() => Promise
      • Properties
        • element => Element
        • isActive => Boolean
      • Static Properties
        • fullscreenElement => Element
        • isSupported / fullscreenEnabled => Boolean
      • Events
        • change / fullscreenchange => (Boolean isActive, Event e)
        • error / fullscreenerror => (Error err, Event e)
        • unsupported => ()

    License

    MIT

    Install

    npm i jsfullscreen

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • ardean