国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

jQuery手機端上拉刷新下拉加載更多頁面

2024-04-27 15:00:26
字體:
來源:轉載
供稿:網友

基于jQuery手機端上拉下拉刷新頁面代碼。這是一款類似QQ空間客戶端或者微信下拉刷新頁面特效代碼。效果圖如下:

在線預覽    源碼下載

實現的代碼。

html代碼:

 <div id="wrapper">        <ul>            <li>row 10</li>            <li>row 9</li>            <li>row 8</li>            <li>row 7</li>            <li>row 6</li>            <li>row 5</li>            <li>row 4</li>            <li>row 3</li>            <li>row 2</li>            <li>row 1</li>        </ul>    </div>    <script>        for (var i = 0; i < document.querySelectorAll("#wrapper ul li").length; i++) {            document.querySelectorAll("#wrapper ul li")[i].colorfulBg();        }        refresher.init({            id: "wrapper",//<------------------------------------------------------------------------------------┐            pullDownAction: Refresh,            pullUpAction: Load        });        var generatedCount = 0;        function Refresh() {            setTimeout(function () {    // <-- Simulate network congestion, remove setTimeout from PRoduction!                var el, li, i;                el = document.querySelector("#wrapper ul");                el.innerHTML = '';                for (i = 0; i < 11; i++) {                    li = document.createElement('li');                    li.appendChild(document.createTextNode('async row ' + (++generatedCount)));                    el.insertBefore(li, el.childNodes[0]);                }                wrapper.refresh();/****remember to refresh after  action completed! ---yourId.refresh(); ----| ****/                for (var i = 0; i < document.querySelectorAll("#wrapper ul li").length; i++) {                    document.querySelectorAll("#wrapper ul li")[i].colorfulBg();                }            }, 1000);        }        function Load() {            setTimeout(function () {// <-- Simulate network congestion, remove setTimeout from production!                var el, li, i;                el = document.querySelector("#wrapper ul");                for (i = 0; i < 2; i++) {                    li = document.createElement('li');                    li.appendChild(document.createTextNode('async row ' + (++generatedCount)));                    el.appendChild(li, el.childNodes[0]);                }                wrapper.refresh();/****remember to refresh after action completed?。。?  ---id.refresh(); --- ****/                for (var i = 0; i < document.querySelectorAll("#wrapper ul li").length; i++) {                    document.querySelectorAll("#wrapper ul li")[i].colorfulBg();                }            }, 1000);        }    </script>

via:http://www.w2bc.com/article/55236


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桐庐县| 固镇县| 中西区| 三亚市| 赫章县| 江阴市| 灵璧县| 光山县| 桦川县| 环江| 贺州市| 平阳县| 洛宁县| 两当县| 镇安县| 承德市| 班玛县| 潮安县| 漯河市| 鄱阳县| 石景山区| 长岛县| 隆化县| 惠州市| 沛县| 沅陵县| 浦江县| 南雄市| 秦皇岛市| 安溪县| 浪卡子县| 塘沽区| 贵定县| 桃园市| 诸暨市| 沙河市| 吉木乃县| 武胜县| 华安县| 雅安市| 体育|