Ajax 下拉加载数据

    $(document).scroll(function() {
            var pageHeight = $(document).height()-$(window).height();
            var bodyScrollTop = $('body').scrollTop();
    
            if(bodyScrollTop >= pageHeight) {
                $('#moress').find('.not').remove();
                $.ajax({
                    type : 'get', data: {},
                    url : '/product/ajax/'+start,
                    success: function(a, b, c) {
                        $('#moress').append(a);
                        start = start+10;
                        var width = $('dl').width();
                        var height = Math.floor((width*3)/4);
                        $('dl dt').height(height);
                    }
                });
            }
        })

 

posted @ 2015-10-09 10:42  陈朔  阅读(1077)  评论(0编辑  收藏  举报