New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pause-offscreen

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pause-offscreen

On web pages, hide gifs and pause videos when they're scrolled offscreen, to save CPU cycles

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

pause offscreen

On web pages, hide gifs and pause videos when they're scrolled offscreen, to save CPU cycles.

var pauser = require('pause-offscreen')
var unlistenPauser = pauser(containerEl)
ui.onTeardown(unlistenPauser)

Notes

  • Only bothers checking vertical scroll position
  • Does not check if the page is visible (just checks if the element is in the viewport)
  • Shows/hides on initial call, then on scroll
  • Hides all images when they go out of viewport (visibility=hidden) because my usecase couldnt use the filename's extension to differentiate gifs from other images.

Keywords

gif

FAQs

Package last updated on 30 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts