Skip to content

neuedaten/in-viewport-class

Repository files navigation

in-viewport-class

A plain javascript library (~1kb) that adds classes to elements in viewport. This Repository also includes a jQuery version.

Install

Plain Javascript:

<script src="dist/in-viewport-class.js"></script>

jQuery

include this script after the jQuery library:

<script src="dist/jquery.in-viewport-class.js"></script>

bower

bower install in-viewport-class

npm

npm install --save in-viewport-class

Use

add i-v class to every element you want to observed.

<div class="element i-v"></div>

Classes

  • in-viewport added when the element enter the viewport, removed when the element left the viewport
  • was-in-viewport added when the element left the viewport
  • in-viewport-once added when the element enter the viewport first, newer removed

Example

www.neuedaten.de/in-viewport-class/

or have a look at example-plain-javascript.html or example.html

About

A plain javascript library (~1kb) that add classes to elements in viewport (also as jquery plugin)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy