当前位置:网站首页>Single page pull-down refresh and double page pull-down refresh of MUI
Single page pull-down refresh and double page pull-down refresh of MUI
2022-06-11 23:27:00 【RxnNing】
Single page (style Cannot write unit Otherwise, only one pull-down refresh )
# Bind the container to which you want to bind the drop-down
<div class="mui-content mui-scroll-wrapper" id="refreshContainer">
<div class="mui-scroll">
Content
</div>
</div>
# To configure mui.init()
mui.init({
pullRefresh: {
container: "#refreshContainer", // Drop down refresh container ID ,querySelector Able to locate css All selectors , such as :id、.class etc.
down: {
style: 'circle', // Mandatory , Drop down refresh style , Currently supports native 5+ ‘circle’ style
color: '#2BD009', // Optional , Default “#2BD009” Drop down refresh control color
height: '50', // Optional , Default 50px. Drop down refresh control height ,
range: '100', // Optional Default 100px, Control can be dragged down the range
offset: '0p', // Optional Default 0px, Drop down to refresh the start of the control
auto: true, // Optional , Default false. First load auto pull up refresh once
callback: callfunction // Mandatory , Refresh function , Write according to specific business , Such as through ajax Get new data from the server ;
}
}
});
# After the configuration data is updated, the pull-down refresh is folded
function callfunction() {
setTimeout(function() {
// Timer , Enhance user experience
mui.toast(' Updated 5 An article ');
mui('#refreshContainer').pullRefresh().endPulldownToRefresh(); // Complete refresh
}, 1500);
}
Double page drop-down refresh data
# Configure paging first
#index.html in
#body part
<!-- Drop down refresh container -->
<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<!-- Displayed button.html The page data -->
</div>
</div>
mui.init({
subpages: [
{
url: 'button.html', // Subpage HTML Address , Support local address and network address
id: 'button.html', // Subpage flag
styles: {
top: '45px', // Top of subpage
bottom: 0, // Sub page bottom position =
},
extras: {
} // Additional extension parameters
}],
swipeBack:true ,// Enable right slide close function
statusBarBackground: '#000000'
})
}
# Subpage section
<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<!-- Data list -->
</div>
</div>
mui.init({
pullRefresh : {
container:"#refreshContainer",// Drop down refresh container ID ,querySelector Able to locate css All selectors , such as :id、.class etc.
down : {
height:50,// Optional , Default 50. Trigger pull down refresh drag distance ,
auto: false,// Optional , Default false. First load automatic pull-down refresh once
contentdown : " Drop down to refresh ",// Optional , When the dropdown can refresh the status , Pull down to refresh the title content displayed on the control
contentover : " Release refresh now ",// Optional , When a refreshable state is released , Pull down to refresh the title content displayed on the control
contentrefresh : " Refreshing ...",// Optional , While refreshing state , Pull down to refresh the title content displayed on the control
callback : pullfreshFunction // Mandatory , Refresh function , Write according to specific business , Such as through ajax Get new data from the server ;
}
}
});
function pullfreshFunction() {
setTimeout(function() {
// Timer , Enhance user experience
mui.toast(' Updated 5 An article ');
mui('#refreshContainer').pullRefresh().endPulldownToRefresh(); // Complete refresh
}, 1500);
}
边栏推荐
- 2022 safety officer-b certificate theoretical question bank and simulation test
- [day15 literature extensive reading] numerical magnetic effects temporary memories but not time encoding
- C language simple exercise No.17, about the combination of for and while loops
- How to make scripts executable anywhere
- Read the logstash principle
- Fonctionnement de la plate - forme d'examen de simulation pour les agents de sécurité - Questions d'examen de certificat a en 2022
- [day6-7 intensive literature reading] a unifying Bayesian framework accounting for spatiotemporal interactions with a
- 2022年安全员-B证理论题库及模拟考试
- 2022 R1 quick opening pressure vessel operation test questions and online simulation test
- Research Report on development trend and competitive strategy of global non directional beacon industry
猜你喜欢

The second bullet of in-depth dialogue with the container service ack distribution: how to build a hybrid cloud unified network plane with the help of hybridnet

Unity3d C#开发微信小游戏音频/音效播放问题解决过程分享

Top selling commodities 【 project mall 】

Pad printing process flow and application precautions

Software installation and use, etc

A new product with advanced product power, the new third generation Roewe rx5 blind subscription is opened

2022年安全員-A證考題模擬考試平臺操作

Implementation scheme of iteration and combination pattern for general tree structure

2022年高处安装、维护、拆除操作证考试题库模拟考试平台操作

SDNU_ ACM_ ICPC_ 2022_ Weekly_ Practice_ 1st (supplementary question)
随机推荐
2022年安全员-A证考题模拟考试平台操作
一文读懂Logstash原理
Postgresql10 process
Zigbee3.0 wireless packet capturing installation method based on e18-2g4u04b
postgresql10 進程
产品力进阶新作,全新第三代荣威RX5盲订开启
我的创作纪念日
Here we go! Dragon lizard community enters PKU classroom
Super Codex from the open source world, the authoritative release of China's open source Codex list!
Jetpack architecture component learning (3) -- activity results API usage
Queue (C language)
Lake Shore—SuperTran-VP 连续流低温恒温器系统
Pourquoi Google Search ne peut - il pas Pager indéfiniment?
Research Report on development trend and competitive strategy of global reverse osmosis membrane cleaning agent industry
删除收货地址【项目 商城】
Try catch
oracle中dblink操作
05 classification learning notes lihongyi's in-depth study 2021
Google搜索为什么不能无限分页?
Why can't Google search page infinite?