页面向下滚动自动加载数据函数
<script type="text/javascript">
$(function(){
var range = 0;
var maxnum = 90;
var num = 0;
var totalheight = 0;
$(window).scroll(function() {
var srollPos = $(window).scrollTop();
totalheight = parseFloat($(window).height()) + parseFloat(srollPos);
if(($(document).height() - 0) <= totalheight && num != maxnum) {
//把要添加的数据写到下面函数中,即可实现滚动添加
getStockList();
//num++;
}
});
}
</script>