Skip to content

Know if some element is being viewed and trigger to anything you want.

Notifications You must be signed in to change notification settings

thisisddzin/element-viewer

Repository files navigation

INSTALLATION

SCRIPT

<script src="https://unpkg.com/element-viewer@1.0.2/dist/element-viewer.min.js"></script>

NPM

npm i element-viewer

YARN

yarn add element-viewer

USAGE:

elementViewer({
  elementSelector: '.stamped-io', // the element selector to observe if being visualized
  visualizationTimer: 3000 // time to consider the visualization
}, () => {
  sendToAnalytics('review_viewed') // send to analytics with the event name (example method)
})

DEVELOPMENT

  • Light Weight on Bundlephobia
  • The final file, minified and with babel is: dist/element-viewer.min.js

About

Know if some element is being viewed and trigger to anything you want.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published