Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mangoweb/in-view

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mangoweb/in-view

Watches elements entering and leaving viewport.

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

InView

The manGoweb InView component. Watches elements entering and leaving viewport.

Installation

npm install @mangoweb/in-view @mangoweb/scripts-base

This is a @mangoweb/scripts-base component.

Usage

In your template:

<script>
	window.initComponents = (window.initComponents || []).push({
		name: 'InView',
		place: '#targetWrapper', // Element you want to watch or a wrapper
		data: { // Optional
			targets: '.target', // Watched children
			threshold: 0, // Area of a target required to be inside viewport

			isAboveViewClass: 'isAboveView', // Class added to a target element when seen above viewport
			isInViewClass: 'isInView', // Target seen in viewport
			isBelowViewClass: 'isBelowView', // Target seen below viewport
			isSeenClass: 'isSeen', // Target seen in viewport at least once
		}
	})
</script>

IE support / older Safari (caniuse)

Use IntersectionObserver polyfill, e.g., <script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver"></script>

FAQs

Package last updated on 12 Oct 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc