2.0.1 • Published 5 years ago
newexposure v2.0.1
newExposure
introduction:
The newExposure is a tool for collecting exposure info in web page when user scroll the page.
It can be used by passing a request URL or a callback function, and can be setted as doing once action or more.
usage:
step 1: include the js file in your web page
with npm:
npm install --save newExposurethen:
import newExposure from 'newexposure'or.
download in your local project manually
then:
<script src="js/newExposure.js"></script>step 2: call the following method when you need to add exposure:
newExposure.pushListeningEle(ele, action, canRepeat)eg.
newExposure.pushListeningEle(document.querySelector('#exp'), 'https://xxx.com/1.gif', false);or.
newExposure.pushListeningEle(document.querySelector('#exp'), () => { console.log('showing...'); }, true);