Home  >  Article  >  Web Front-end  >  Iscool pull-down refresh implementation method

Iscool pull-down refresh implementation method

小云云
小云云Original
2018-01-06 10:23:211369browse

This article mainly brings you a method to implement the Iscool pull-down refresh function (recommended). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.

Simple pull-down refresh implementation method

css style:

*{
        margin: 0px;
        padding: 0px;
        
      }
      #wrapper{
        width: 100%;
        height: 150px;
        border: 1px solid red;
        overflow: hidden;
        position: absolute;
      }
      #shua{
        text-align: center;
      }

HTML code

<p id="wrapper">
      <p>
        <p id="shua">刷新</p>
        <ul>
          <li>1</li>
          <li>2</li>
          <li>3</li>
          <li>4</li>
          <li>5</li>
          <li>6</li>
          <li>7</li>
          <li>8</li>
          <li>9</li>
          <li>10</li>
        </ul>
      </p>
    </p>

Before writing js code, you must introduce the jQuery plug-in and iscroll plug-in

Then the js code is as follows: