<script>var Page=2;var finished=0;$ (document). Ready (function () {var range = 1;//distance below boundary length/unit Pxvar pages = $ ("# Listpages "). Val (), var totalheight = 0;var main = $ (" #loadList "); The principal element $ (window). Scroll (function () {var srollpos = $ (window). scrolltop ();//The distance from the top of the scroll bar (the page exceeds the height of the window) Totalheight = parsefloat (window). Height ()) + parsefloat (Srollpos), if (finished = = 0) {if ($ (document). Height ()-range) < Totalheight) {finished=1;if (Page < pages | | page = = pages) {nextPage (page);p age++;} else{$ (' #loading '). Remove (); $ (' #loadList '). Append (' <a href= "javascript:;" class= "Clear loadmorebtn" > duang~ </a> ');}}}); function NextPage (page) {$.ajax ({url: ' {url:/college/college_newlist_ajax} ', type: ' POST ', data: "num = "+page+" &top=1 ", DataType: ' JSON ', success:function (JSON) {if (Json.error_code > 0) {alert (Json.erro R_MSG); return; if (typeof json = = ' object ') {var commenthtml = '; for (var item in Json.data) {if (json.data[item][' attribute '] = = ' V ') {comm EntHtml + = Template.render (' videotemplate ', Json.data[item]);;} else if (json.data[item][' Thumb_img_number ' > 1) {commenthtml + = Template.render (' moretemplate ', Json.data[item]);} else{commenthtml + = Template.render (' onetemplate ', Json.data[item]);}} commenthtml+= ' <a id= "Loading" href= "javascript:;" class= "clear loadmorebtn" > Load in ...</a> '; $ (' #loadList ') . append (commenthtml); $ (' #loading '). Remove (); finished=0; } } });} </script>
Drop-down loading next page