/cc-inviewport

📱 To determine whether the HTMLElement is in the viewport

Primary LanguageJavaScriptMIT LicenseMIT

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