screenfull.js: Simple wrapper for cross-browser usage of the JavaScript Fullscreen API

Using the JS fullscreen API is painful because all browers use different methods and events Archive and you need to use lots of boilerplate code to make your application work in all browsers.

The "screenfull" library wraps that for you, including events.


The linked GitHub repo contains some information. You basically use the library like this:

// Make an element go fullscreen

// Leave fullscreen

// Detect if something is currently fullscreen

// Register event when going fullscreen
screenfull.on('change', functionCallback)    

// Get element that is currently fullscreening

// De-register event'change', functionCallback)

Note that no jQuery is required even though on and off may look like jQuery.

Arne Hartherz over 4 years ago
This website uses short-lived cookies to improve usability.
Accept or learn more