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

scrollinview

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrollinview

Easily trigger classes as elements enter the viewport

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Scroll in View

A tiny library that triggers classes on elements as they scroll into the viewport.

Installation

Scroll in View makes use of Core Events, so be sure to install this as a dependancy if you haven't already.

npm install scrollinview core-events

Usage

import Event from 'core-events'
import scrollinview from 'scrollinview'

const event = new Event()

scrollinview(event)
<div class="content" data-scroll-in-view>
  <!-- Content here -->
</div>

As soon as the element enters the viewport, a js-scroll-in-view class is added allowing a css animation to be triggered — this class can also be customised using an option (see below).

Options

The scrollinview function can optionally take an object as the second argument, that may include the following properties.

className

The class name that Scroll in View uses when an element enters the viewport (defaults to js-scroll-in-view).

scrollinview(event, { className: 'my-custom-class' })

FAQs

Package last updated on 09 Feb 2018

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