mui 上拉刷新下拉加载

MUI选项卡下拉刷新上拉加载demo 这是一个基于mui框架下实现的一个上拉刷新,下拉加载的一个数据加载demo这样的做法是为了提高用户的体验感,减少服务器的压力~ 立即下载

最近多处地方用到这块的功能,顺便总结下。
1

<!--下拉刷新容器-->
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
  <div class="mui-scroll">
    <!--数据列表-->
    <ul class="mui-table-view mui-table-view-chevron">
    </ul>
  </div>
</div>

2

        //初始化
    mui.init({
        pullRefresh: {
            container: "#refreshContainer", //下拉刷新容器标识
            down: {
                auto: false,
                contentdown: "下拉可以刷新",
                contentover: "释放立即刷新",
                contentrefresh: "正在刷新...",
                callback: pullDownFresh
            },
            up: {
                height: 50, //可选.默认50.触发上拉加载拖动距离
                auto: false,
                contentover: "释放立即加载",
                contentrefresh: "正在加载...",
                contentnomore:'没有更多数据了',
                callback: pullupFresh
            }
        }
    });

3

   //  上拉加载
    function pullupFresh() {
        setTimeout(function() {
            var lastId = document.getElementById("lastId").value;
            if(isPullupOver) {//判断是否拉完,也可以放到endPullupToRefresh(表达式)进行判断
                                    mui('#refreshContainer').pullRefresh().endPullupToRefresh(true) //结束上拉加载true结束false不结束
            } else {
                mui('#refreshContainer').pullRefresh().endPullupToRefresh(false) //结束上拉加载true结束false不结束
                queryList("0",lastId);//后台通过最后一条数据查下边的
            }
        }, 1500);
    }
    //  下拉刷新
    function pullDownFresh() {
    var firstId = document.getElementById("firstId").value;
        setTimeout(function()           
            queryList("1",firstId);//后台通过第一条数据查上边的
            mui('#refreshContainer').pullRefresh().endPulldownToRefresh();
        }, 1500);
    }

当然ajax里边还有挺多的逻辑,下边我一一阐述下
(1)初始请求数据为空时,不能直接判断data.length.应该加上上拉下拉的次数,否则当上拉或则下拉的时后没数据时,直接展示暂无数据了。(++time == 1 && da.length == 0)//初始进来有没有数据)

mui 上拉下拉刷新功能 mui 上拉下拉刷新功能 mui 上拉下拉刷新功能 mui 上拉下拉刷新功能 立即下载

相关推荐

ZYQN7000系列VxWorks驱动开发:VxWorks系统移植

文章目录ZYQN7000驱动开发:VxWorks系统移植1.硬件环境2.编译vsb和vip工程2.1修改设备树文件2.2添加调试打印组件3.选择uboot来启动VxWorks内核4.尝试在开发板上启动内核4.1 拷贝镜像和设备树至SD卡4.2开发板上电4.2.1 uboot成功启动4.2.2 启动VxWorks5.添加shell和cmd组件 ZYQN7000驱动开发:VxWorks系统移植 1.硬件环境 正点原子领航者开发板 2.编译vsb和vip工程 vsb和vip工程的编译过程可以参考之前的文章,htt

明故宫的记忆 5506

mui-上拉加载和下拉刷新

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>mu

weixin_47808670的博客 1232

从ARCore到AICore:揭秘Google如何通过系统级服务推动Android生态创新

本文深入探讨了Google如何通过AICore等系统级服务推动Android生态创新。从ARCore到AICore,Google通过分层解耦策略将AI能力下沉至系统层,实现端侧大模型推理,如Gemini Nano在Pixel 8 Pro中的应用。文章剖析了AICore的技术架构、开发者赋能路径及场景化实践,展示了其在通信、内容创作和生产力工具中的卓越表现。

rust6ferris的博客 545

mui上拉刷新和下拉加载

mui是h5十大框架之一。很好用,但是针对不同的场景,文档的描述不够我们理解。 场景:通过mui的上拉加载更多数据,下拉刷新回刚刚进入当前页面的状态。笔者设置每次上拉就清空旧页面的内容,把新加载的10条数据渲染到页面上,当下拉时候,恢复到第一次加载的状态。 问题:当上拉加载的数据达到最多时候,通过 mui('#pullrefresh').pullRefresh().endPullupToRefre...

SanPhantom的博客 663

一文掌握python图形界面开发PyQt6--(一)基本操作、控件、信号与槽、常用控件、布局管理、事件处理、文件对话框

一文掌握python图形界面开发PyQt6--(一)基本操作、控件、信号与槽、常用控件、布局管理、事件处理、文件对话框

qq_38120851的博客 4046

Zoom AI 技术架构研究:联合式方法与多模态集成

通过 Zoom AI 开放平台,企业可以自定义 AI 模块 (如法律合规审查、客户反馈分析),扩展应用场景。这种开放平台策略使企业能够根据自身需求定制 AI 功能,满足特定业务需求。

shao.bing的专栏 1318

mui的上拉刷新与下拉加载

<head> <meta charset="utf-8"> <title>Hello MUI</title> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"> <met...

weixin_45932157的博客 246

舵机PWM信号转互斥继电器开关信号

-----------------本文由“麦粒电子”撰写,并提供相应产品服务。---------------- 叙述 上次的PWM转继电器开关方案得到大家的不少好评(博客链接),但是发现有些玩家需要一路PWM同时去控制两路继电器开关通断,并且两者是互斥的,好去控制两种不同的负载。所以就继续升级了如下的模块。 正常的控制部件顺序这样:遥控器按钮拨动,遥控器接收机相应通道PWM值变化,PWM转开关模块检测PWM值发生变化从而驱动相应机械继电器触点吸合释放。本模块的两个继电器动作是互斥的,也就是不会同时吸合。

Mai_LiElectronic的博客 1633

MUI-上拉刷新和下拉刷新

MUI-上拉刷新和下拉刷新

记录和分享属于我的“IT”时光。 2896

从零开始学习AI人工智能本体论:概念与实战

本文旨在为初学者提供一个全面而易于理解的人工智能本体论入门指南。我们将覆盖从基本概念到实际应用的全过程,帮助读者理解本体论在AI系统中的核心作用。核心概念与联系:介绍本体论的基本概念和原理核心算法与操作步骤:详细讲解本体构建和推理方法项目实战:通过实际案例展示本体论的应用实际应用场景:探讨本体论在不同领域的应用未来发展趋势:展望本体论在AI领域的前景本体论(Ontology): 在AI中,指对特定领域概念及其关系的明确形式化描述。

AI智能探索者的博客 868

人工智能训练师三级·模型生命周期真题40题|训练→评估→调优全链路通关

本文为人工智能训练师三级考试真题解析系列第2篇,聚焦模型生命周期全链路(训练→评估→调优)。内容包含40道精选真题,覆盖数据划分、模型训练、评估指标、超参数调优4个核心阶段。重点考察:1)数据集的合理划分方法(留出法、交叉验证);2)模型训练的基本原理;3)关键评估指标(准确率、召回率、F1等)的应用场景;4)超参数调优技术(网格搜索、随机搜索等)。通过真题解析帮助考生系统掌握模型生命周期的闭环迭代方法论,提升从数据准备到模型优化的全流程实践能力。适合备考人工智能训练师三级认证的考生学习参考。

白话机器学习 89

移动端开发框架mui之上拉刷新、下拉加载数据(选项卡左右移动自动和刷新指定选项卡内容)

移动端开发框架mui之上拉刷新、下拉加载数据(选项卡左右移动自动和刷新指定选项卡内容)

zgphacker2010的专栏 1181

C#实战大华智能安防系统:从SDK封装到视频流与智能报警的全链路落地

本文将介绍C#集成大华SDK开发安防系统的实战经验,重点解决多路视频预览卡顿和报警延迟问题。文章通过三层架构设计(SDK封装层、业务服务层、应用层)实现解耦,详细分析线程安全封装、高效解码显示和智能事件联动等核心技术。针对16路摄像头同时预览时CPU占用率过高的问题,提出使用子码流拉流与异步解码的优化方案,并总结8个常见开发陷阱的解决方案。文中还提供了大华智能安防系统的完整架构图,展示从设备层到应用层的交互流程,特别强调业务服务层中视频流服务和智能报警服务的核心功能设计。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 432

mui上拉刷新下拉加载

mui 上拉刷新下拉加载 在做列表上拉刷新下拉加载的时候遇到了一些问题 总结一下供大家参考 这里我用到了一个自己封装的工具类来调mui post方法的  大家也可以用mui本身自己去调用 1.html代码 2.script代码 var commonHelp = new CommonHelp(); mu

yangsitong1314的博客 1912

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

mui上拉刷新下拉加载模板2)

mui上拉刷新下拉加载 mui版本:Mui v3.7.2 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-...

u013008898的博客 2589

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

mui上拉加载前端和PHP后端,vue2+mui实现上拉刷新下拉加载

# mui+vue2.0 实现上拉刷新下拉加载> 来源: http://banyingli.cn/?p=92#### HTML```html{{item.title}}```#### JavaScript```javascriptvar demo = new Vue({el: '#pullrefresh',data: {count : 0,items : [{title: 'item1'}]...

weixin_30920223的博客 203

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

mui下拉加载 php,MUI 上拉刷新/下拉加载功能实例代码

新闻信息列表必备的功能,支持Table,Ul等列表.以下是DIV版本,在安卓端或者ios端必须使用双webview模式,传送门:http://dev.dcloud.net.cn/mui/pulldown/mui.init({pullRefresh:{container: '#pullrefresh',down: {callback: pulldownRefresh},up: {contentref...

weixin_36352025的博客 293

mui 上拉刷新下拉加载 pullToRefresh

/** * 分页 */ function pagination() { mui('.mui-scroll-wrapper').scroll({ indicators: true }); //初始化scroll组件 // 刷新组件对象 // 处理中 var pullToRefresh = mui('#refresh_container').pullToRefresh({ do...

baidu_24743861的博客 2787

mui上拉刷新下拉加载模板1)

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximu...

u013008898的博客 2073

mui实现上拉刷新与下拉加载功能

引言 下拉刷新与上拉加载功能可谓是现在APP开发的两个常见功能,在电脑端我们常常通过点击分页的形式来向用户展示更多内容,不过在移动端我们可不想有这些多余的点击操作,只要想看更多内容只要下拉话上拉就可以了,这个小技巧可以大大的提高用户体验,下面我们来简单的了解一下MUI是如何实现这两种功能的。 关键点1: 初始化下拉刷新与上拉加载功能 mui.init({ pullRefresh...

浪子四方 1179

mui上拉刷新+下拉加载

具体操作见代码: <!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-w...

weixin_30463341的博客 89

mui的上拉刷新 下拉加载

(function($) { //阻尼系数 // alert(lastid) mui.init({ swipeBack: true //启用右滑关闭功能 }); var deceleration = mui.os.ios ? 0.003 : 0.0009; $('.mui-scroll-wrapper').scroll({ bounce: false, indicators: f

h5liangliang的博客 956

MUI上拉刷新下拉加载

使用之前引入文件 &lt;link rel="stylesheet" href="../lib/mui/css/mui.css"&gt; &lt;script src="../lib/mui/js/mui.js"&gt;&lt;/script&gt;   HTML // lt_view 为下拉-上拉的容器 里面必须加一层嵌套 div &lt;div class=&qu

大强aken的博客 274

mui的上拉刷新和下拉加载(动态加载)

&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;meta charset="utf-8"&gt;         &lt;title&gt;社区&lt;/title&gt;         &lt;meta name="viewport" content="width=de

大海无量的博客 3260
上一篇: js this
下一篇: 移动端(h5)上传,压缩,预览图片
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值