newexposure

2.0.1 • Public • Published

newExposure

  1. 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.

  2. usage:

    step 1: include the js file in your web page

    with npm:

    npm install --save newExposure

    then:

    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);

Package Sidebar

Install

npm i newexposure

Weekly Downloads

1

Version

2.0.1

License

ISC

Unpacked Size

5.18 kB

Total Files

4

Last publish

Collaborators

  • eniumeng