🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mscroll

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mscroll

mScroll pull down refresh, pull up load more.

beta
npmnpm
Version
0.1.1
Version published
Weekly downloads
9
80%
Maintainers
1
Weekly downloads
 
Created
Source

mScroll -- pull down refresh and pull up load more. only use in Mobile devices

  • pull down update
  • pull up load more

#use document

install

  npm install mScroll --save

useage

1. npm run build

1. browserify mscroll.js --deubg > bundle.js

1. in browser use bundle.js

##dependency

zepto-modules

API

.pull

  var Pull = mScroll.pull;
  var refresh = new Pull ('.js-content', {
        msgElement: '.js-msgwrap',
        msgs: ['下拉刷新.....', '释放刷新'],
        distance: 10,
        start: function () {
          //console.info('start');
        },
        move: function () {
          //console.info('move');
        },
        end: function () {
          //console.info('end');
        },
        onRefresh: function () {
          let ul = document.querySelector('.js-ul');                    
          let random = 1; 
          // after refresh do something you want
          setTimeout(() => {           
            this.backTop();
            ul.innerHTML = '';
            for (let i = 0; i< 25; i++) {
              random = (Math.random() * (20 - 1) + 1).toFixed(0);
              ul.innerHTML +=`<li>
                              我是刷新后内容${random}
                             </li>`;
            }
          }, 1000);
        }
      });

.more

  

FAQs

Package last updated on 21 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts