...
|
...
|
@@ -299,18 +299,23 @@ define('mobile', function(require, exports) { |
|
|
var totalPage = Math.ceil(total / (limit * (total_times + 1)));
|
|
|
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 50) {
|
|
|
if (total > limit && times < total_times && page <= totalPage) {
|
|
|
if($(".main-layout").attr("is_ajax") == 1 || $("#img_page").size())
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
$(".main-layout").attr("is_ajax", 1);
|
|
|
$.ajax({
|
|
|
beforeSend:function() {
|
|
|
if($(".loading").size() == 0)
|
|
|
{
|
|
|
$(".main-layout").append('<div class="loading"><img src="'+ YohoConfig.resUrl + '/images/yohood/loading.gif'+'" /></div>');
|
|
|
if($(".loading").size() == 0) {
|
|
|
$(".main-layout").append('<div class="loading" style="left: 47.5%;position:absolute;"><img src="'+ YohoConfig.resUrl + 'images/yohood/loading.gif'+'" /></div>');
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
type: "get",
|
|
|
url: url + "/page/" + (parseInt(ajaxPage) + 1),
|
|
|
success: function(data) {
|
|
|
$(".loading").remove();
|
|
|
var news_page = $(data);
|
|
|
page = Math.ceil(parseInt(news_page.attr("page")) / (total_times + 1)); //实现页码
|
|
|
if ($(".main-layout").attr("page") != news_page.attr("page") && news_page.html() != "") {
|
|
|
$(".main-layout").append(news_page.html());
|
|
|
$(".main-layout").attr({
|
...
|
...
|
@@ -318,15 +323,18 @@ define('mobile', function(require, exports) { |
|
|
"page": news_page.attr("page"),
|
|
|
"times": ++times
|
|
|
});
|
|
|
// console.log(news_page.attr("page"));
|
|
|
// console.log("times:" + times);
|
|
|
}
|
|
|
page = Math.ceil(parseInt(news_page.attr("page")) / (total_times + 1)); //实现页码
|
|
|
// console.log("page:" + page);
|
|
|
// console.log("totalPage:" + totalPage);
|
|
|
//console.log(news_page.attr("page"));
|
|
|
//console.log("times:" + times);
|
|
|
//console.log("page:" + page);
|
|
|
//console.log("totalPage:" + totalPage);
|
|
|
}
|
|
|
if($(".loading").size()){
|
|
|
$(".loading").remove();
|
|
|
}
|
|
|
if (times == total_times || news_page.html() == "" || page == totalPage) {
|
|
|
$(".main-layout").append(getPagination(page, totalPage));
|
|
|
}
|
|
|
$(".main-layout").attr("is_ajax", 0);
|
|
|
}
|
|
|
});
|
|
|
} else if (page == totalPage) {
|
...
|
...
|
|