"Front-end" pull-up load more dropload.min.js use

Source: Internet
Author: User

The code is as follows: the entry code to modify the interface and HTML for their own can (the following main display JS section)

<! DOCTYPE html>

<meta charset= "UTF-8" >
<meta name= "viewport" content= "Width=device-width, User-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0 ">
<meta name= "referrer" content= "Never" >
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >
<script src= ". /.. /.. /static/js/common/jquery.js "></script>
<!--pull-up loads more-
<link rel= "stylesheet" href= "Http://topmdrt-static.oss-cn-shenzhen.aliyuncs.com/static/css/common/dropload.css"/>
<script src= "http://topmdrt-static.oss-cn-shenzhen.aliyuncs.com/static/js/common/" ></script>
<title> pull-up loads more </title>

<body>
<div class= "content_02" >
<div class= "lists" >
<!--<a href= "javascript:;" >
<div class= "Free_content_box overh" >
<div class= "fl Left" ></div>
<div class= "FL Mid" >
<p class= "title" >10 Safe Travel Insurance </p>
<p class= "Age" >:18-79&ensp;&ensp; insured: 100,000 &ensp;&ensp; coverage period: 30 days </p>
<p class= "More Overh" >
<a class= "FL" href= "javascript:;" > Required Gold: 5 Gold </a>
<a class= "fr under" href= "javascript:;" ><span class= "un" > View details </span> ></a>
</p>
</div>
</div>
</a>-->
</div>
</div>

<script type= "Text/javascript";
//pull-up loads more
var page = 0;
$ ('. content_02 '). Dropload ({
Scrollarea:window,
Domdown: {
Domclass: ' Dropload-down ',
Domrefresh: ' <div class= "Dropload-refresh" >↑ pull-up load more </div> ',
Domload: ' <div class= ' dropload-load ' > Loading </ Div> ',
Domnodata: ' <div class= ' dropload-nodata ' > Loaded complete </div> '
},
Loaddownfn:function (Me) {
Console.log (' 666 ')
page++;//per request, page number plus 1
//Get product Information list render
var data = {
"page": page,
"type_id": 1
}
Console.log (page);
//Render list
$.post (' http://fx.topmdrt.com/ZhongMinWang/listProduct ', data, function (res) {
Console.log (res);
var prod = res.data;
if (Res.errcode = = "0") {
var result = ';
for (var i = 0; i < prod.products.length; i++) {

Result + = ' <a>kai</a> '

if (Prod.products.length < 5 && i = = prod.products.length-1) {
Lock prod.products.length here to change your own length
Me.lock ();
Countless data
Me.nodata ();
Break
}
}
For testing, delay 1 seconds to load
SetTimeout (function () {
$ ('. Lists '). Append (result);
Each time the data is loaded, it must be reset
Me.resetload ();
}, 1000);

} else if (Res.errcode = = "1002") {
$ (". Dropload-down"). Hide ();
Console.log (RES.ERRMSG);
}
}, ' json ')
Threshold:50
}
})
</script>

</body>

"Front-end" pull-up load more dropload.min.js use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.