Posted 4 months ago. Visible to the public. External content.

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 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.

Examples

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

Copy
// Make an element go fullscreen screenfull.request(element) // Leave fullscreen screenfull.exit() // Detect if something is currently fullscreen screenfull.isFullscreen // Register event when going fullscreen screenfull.on('change', functionCallback) // Get element that is currently fullscreening screenfull.element // De-register event screenfull.off('change', functionCallback)

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

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Arne Hartherz
Last edit:
4 months ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more