Skip to content

thisisddzin/element-viewer

Repository files navigation

INSTALLATION

SCRIPT

<script src="https://unpkg.com/[email protected]/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