欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

请问 手机滑动效果怎么做 能说说大概的原理吗 列表 文章 滑动下滑 加载 有努力 加载中 (英文类似的字眼) 等待字眼 上拉 加载更多 有大用 有大大用

shiping1 的头像



请问 手机滑动效果怎么做 

能说说大概的原理吗

 @Enda 是 js  事件 
还是 laravel 事件
Enda(653069653)  11:24:52
肯定是 js 事件
http://www.w2bc.com/article/55236 


搜 "jquery 滑动插件"

 

https://github.com/search?utf8=%E2%9C%93&q=jquery+%E6%BB%91%E5%8A%A8%E6%8F%92%E4%BB%B6&type=Reposito...

 星星最多 比较好 



jQuery手机端上拉刷新下拉加载更多页面


源码下载 我已下载到我的服务器中 附件  jQuery手机端上拉刷新下拉加载.rar

基于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

在线预览    源码下载

 
来自 http://www.w2bc.com/article/55236


普通分类: