Chan-Chun / cc-inviewport

📱 To determine whether the HTMLElement is in the viewport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cc-inviewport

Introduction

To determine whether the HTMLElement is in the viewport.

Installation

CommonJS

Install
npm install cc-inviewport --save

ES6

Install
npm install cc-inviewport --save

Script

Install
<script src="https://unpkg.com/cc-inviewport/dist/inviewport.js"></script>

inviewport is registered in window

syntax

Code
inviewport(HTMLElement, offset);
Parameters
  • HTMLElement

HTML element

  • offset

horizontal offset

About

📱 To determine whether the HTMLElement is in the viewport

License:MIT License


Languages

Language:JavaScript 58.7%Language:HTML 41.3%