
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
element-is-visible-in-viewport
Advanced tools
Tells you if an element is visible (vertically only) in the viewport.
Tells you if an element is visible (vertically only) in the viewport.
The method exported takes 3 arguments:
// Using no Mode.
checkVisible(document.querySelector('.something')) && console.log('ELEMENT IS TOTALLY VISIBLE IN THE VIEWPORT');
// Using the MODE.
checkVisible(document.querySelector('.something'), 'above') && console.log('ELEMENT IS ABOVE THE VIEWPORT');
checkVisible(document.querySelector('.something'), 'below') && console.log('ELEMENT IS BELOW THE VIEWPORT');
checkVisible(document.querySelector('.something'), 'visible') && console.log('ELEMENT IS TOTALLY THE VIEWPORT');
checkVisible(document.querySelector('.something'), 'any') && console.log('SOME PART OF THE ELEMENT IS VISIBLE');
Inspired by thanks to stack overflow user Tokimon.
I made this lib because lately I have been writing a ton of stuff that needs to know if it is in the viewport or not. I got tired or copy and pasting that code mentioned above.
FAQs
Tells you if an element is visible (vertically only) in the viewport.
The npm package element-is-visible-in-viewport receives a total of 20 weekly downloads. As such, element-is-visible-in-viewport popularity was classified as not popular.
We found that element-is-visible-in-viewport demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.