项目作者: mystroken

项目描述 :
:eyes: Get notified when a DOM element appear in and out of view.
高级语言: JavaScript
项目地址: git://github.com/mystroken/intersection.git
创建时间: 2019-09-08T14:13:00Z
项目社区:https://github.com/mystroken/intersection

开源协议:MIT License

下载


Intersection

:eyes: Get notified when a DOM element appear in and out of view.


Consider using the browser API, Intersection Observer, if you don’t care about IE and if you just need a basic support of in / out of viewport notifications.


Installation

  • Via NPM — npm install @mystroken/intersection

  • Manually — @mystroken/intersection/dist/intersection.min.js"">https://unpkg.com/@mystroken/intersection/dist/intersection.min.js


Usage

Look at the source files for more information.

Get started
  1. const options = {};
  2. const o = new Intersection(options);
  3. o.observe(document.querySelectorAll('.in-view'));