jquery weui 滚动加载不触发
<div class="weui-tab">
<!--tabcontent-->
<div class="weui-tab__bd">
<!--tab12二级页 积分详情-->
<div id="tab121" class="weui-tab__bd-item weui-tab__bd-item--active">
<div class="details">
<div class="page-header">
<?= Html::img($this->theme->getAssetUrl('images/logo.png'), ['class' => 'logo']) ?>
</div>
<a href="javascript:;" class="container weui-flex section-header">
<div class="weui-flex__item">
<p class="text-darkdominant text-m"><?= $model ?></p>
<p class="text-darkdominant "><?= $member_rank ? $member_rank['garde'] : '' ?></p>
</div>
<?php if ($member_rank): ?>
<div class="weui-flex__item text-right">
<p class="text-darkdominant text-l"><?= $member_rank ? $member_rank['points'] : '' ?></p>
<p class="text-darkdominant">可用积分</p>
</div>
<?php endif; ?>
</a>
<?php if ($change_log): ?>
<div class="list">
<p class="text-nav text-m"><i class="m-integral text-nav "></i>积分详情</p>
<div class="content">
<?php foreach ($change_log['data'] as $k => $v): ?>
<div class="l weui-flex">
<p class="weui-flex__item text-placeholder text-m2"><?= date('Y-m-d', strtotime($v['changeTime'])) ?></p>
<p class="weui-flex__item text-nav text-m2"><b><?= $v['pointsDesc'] ?></b></p>
<p class="weui-flex__item text-right text-add text-m2">
<b><?= $v['pointsChange'] ?></b></p>
</div>
<?php endforeach; ?>
</div>
<div class="weui-loadmore">
<i class="weui-loading"></i>
<span class="weui-loadmore__tips">正在加载</span>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!--底部导航-->
<div class="weui-navbar">
<a href="<?= Url::to(['default/index']) ?>" class="weui-navbar__item ">
首页
</a>
<a href="<?= Url::to(['/activity/default/activity']) ?>" class="weui-navbar__item">
活动
</a>
<a href="<?= Url::to(['default/my-info']) ?>" class="weui-navbar__item">
我的
</a>
<a href="<?= Url::to(['default/feedback']) ?>" class="weui-navbar__item weui-bar__item--on">
意见反馈
</a>
</div>
</div>
var loading = false; //状态标记
var currentPage=1
if($('.list .l').length<5){
$('.weui-loadmore').hide();
}
$(function() {
$('.details').infinite().on("infinite", function() {
console.log($("#data-module").val()+'/default/score-detail')
if(loading) return;
loading = true;
$.ajax({
url:$("#data-module").val()+'/default/score-detail',
data:{currentPage:currentPage},
contentType: "application/json; charset=utf-8",
success: function() {
currentPage++
}
})
setTimeout(function() {
$("#list").append("<p> 我是新加载的内容 </p>");
loading = false;
}, 1000); //模拟延迟
});
})
滚动加载没触发
![图片上传中...]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
设置$('.details')元素的高度(height),并且设置overflow:auto;
设置$('.details')元素的高度(height),并且设置overflow:auto;(亲测有效)
初始化的时候,也需要去绑定当前选中界面的元素来操作: