Skip to content

Detects your element in viewport and allows you to add a callback function.

License

Notifications You must be signed in to change notification settings

jcedb/js-element-spy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-element-spy

Detects your element in viewport and allows you to add a callback function.

Installation

Use npm to install js-element-spy.

npm install js-element-spy --save

Usage

import { elementSpy } from 'js-element-spy';

elementSpy(
  '.my-element',
  () => {
    // Set your logic here
  },
  'scroll'
);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Detects your element in viewport and allows you to add a callback function.

Resources

License

Stars

Watchers

Forks

Packages

No packages published