Comments (5)
列表内容少于1页,应该在mescroll.endSuccess( dataSize ); 传入dataSize,内部会自动判断已无下一页~
如果是列表内容没有暂满屏幕,还有下一页,需要自动加载下一页的话,可配置up:{ loadFull: {use : true} },自动加载满屏
多看看案例和文档哦
from mescroll.
小姐姐太给力,问题依旧
from mescroll.
var size = 5;
var mescroll = new MeScroll("mescroll", {
down: {
auto: true,
isBoth: false,
callback: downCallback
},
up: {
auto: true,
isBoth: false,
loadFull: { use: true, delay: 500 },
htmlNodata:'<p class="upwarp-nodata">-- 已到底 --</p>',
callback: upCallback
}
});
function downCallback() {
$.ajax({
url: '@Url.Content("~/content-hub/news/")' + departmentId + '/' + menuId + '/0/' + firstId + '/' + size,
success: function (data) {
var result = '';
var arrLen = data.newsList.length;
alert(arrLen);
if (arrLen < 7)
mescroll.endSuccess(arrLen);
else
mescroll.endSuccess();
if (arrLen > 0) {
firstId = data.firstNewsId;
lastId = data.lastNewsId;//0:为刷新,若10:则仅更新firstId;
result = getHtml(data.newsList);
$('.article_list_' + menuId).html(result);
console.log();
}
//$("#mescroll").removeClass("mescroll-hardware");
//$(".article_list_" + menuId).show();
},
error: function (data) {
mescroll.endErr();
}
});
}
function upCallback(page) {
$.ajax({
url: '@Url.Content("~/content-hub/news/")' + departmentId + '/' + menuId + '/20/' + lastId + '/' + size,//20:标签后增加;10:标签前增加;0:刷新
success: function (data) {
var arrLen = data.newsList.length;
if (arrLen == 0)
mescroll.endSuccess(0);
else
if (arrLen < 5)
mescroll.endSuccess(5);
else
if (arrLen == 5)
mescroll.endSuccess(100);
if (arrLen > 0) {
lastId = data.lastNewsId;
result = getHtml(data.newsList);
$('.article_list_' + menuId).append(result);
}
},
error: function (data) {
mescroll.endErr();
}
});
}
from mescroll.
亲 size不能这样修改的; 如果你要修改一页5条数据,必须在new Mescroll的时候配置
//创建MeScroll对象 var mescroll = new MeScroll("mescroll", { down: { page: {size: 5} //配置每页加载5条数据 }, up: { callback: upCallback } });
from mescroll.
http://www.mescroll.com/qa.html#q7
from mescroll.
Related Issues (20)
- mescroll-empty可以提供一个插槽 或者自定义样式吗? HOT 1
- onShow中重置列表报Cannot read properties of null (reading 'offsetWidth')
- 页面切换,beforeRouteEnter定位滚动条无效
- uni-app 小程序中 typeError: Cannot read property 'src' of null HOT 3
- 微信开发者工具报错TypeError: Cannot read property 'nv_callType' of undefined
- Cannot read property 'y' of undefined
- mescroll-uni 空数据不显示空数据UI HOT 1
- 建议支持虚拟列表 HOT 2
- 吸顶轮播菜单导航在Android端下拉刷新的BUG
- mescroll-body 分页每页10条 最后一页或者首页正好是10条 可以一直加载
- 外部滚动条,设置了固定高度百分比
- vite中使用出现does not provide an export named 'default'错误
- h5下mescroll.scrollTo()方法导致无法滑动
- 调用mescrollItems[tabIndex.value].value.getMescroll().resetUpScroll()子组件未接收到父组件参数
- 微信小程序 横屏跳转竖屏 HOT 4
- 官方网站挂了么? https://www.mescroll.com/ HOT 1
- 当使用mescroll-body时 页面上拉到一定高度后刷新页面会触发onReachBottom HOT 1
- 在小程序中如何隐藏滚动条呢?
- mescroll无法访问
- 数据为空、回到顶部等默认图片好像又访问不到了,官网又挂了么
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mescroll.