redrec.html
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html >
<html>
<head>
<meta charset="UTF-8">
<title>红包详情</title>
<include file="public/header"/>
<link rel="stylesheet" href="__STATIC__/css/redbag.css?v=__CSSVERSION__" type="text/css">
<body>
<div class="redware">
<div class="listware1">
<img class="listit" src="__STATIC__/images/redbag/listit.png" alt="">
<ul id="redlist">
</ul>
<div id="getmore" style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem;">
<a href="javascript:void(0)" onClick="getred_reclist()">点击加载更多</a>
</div>
</div>
</div>
<include file="public/navBall"/>
</body>
</html>
<script>
var page = 1;
///滑动到底部事件
$(document).unbind("scroll");
$(document).bind("scroll", function (event) {
if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
if($("#getmore:visible").length>0){
getred_reclist();
}
}
});
function Trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
getred_reclist();
function getred_reclist() {
$.ajax({
type: "get",
url: "/index.php?m=Mobile&c=Redbag&a=ajaxredrec&rec_id={$rec_id}&p=" + page + "&stoid=<?php echo getMobileStoId()?>",
success: function (data) {
$('.getmore').hide();
if (data && Trim(data)!="") {
$("#redlist").append(data);
$('.getmore').show();
page++;
} else {
$('#getmore').hide();
}
},
error:function(XMLHttpRequest, textStatus, errorThrown){
$("#getmore").hide();
}
});
}
</script>