zoukankan      html  css  js  c++  java
  • 手机端列表做异步加载!

    这里做异步加载只是一个简单的用JS来处理异步加载和展示出来的数据,做一个简单的记录:

    <script type="text/javascript">
    (function(){
    var chanpinListUrl = __ROOT__+"?a=Index&c=Index&m=ajaxchanpinlist";
    var info = oStr = oSum = "";
    $(window).scroll(function(){
        if($(document).scrollTop()+$(window).height()>=$(document).height()){
            oSum = $('div.chanpinListBox>a').size();
            $.post(chanpinListUrl,{sum:oSum},function(result){
                eval("info="+result);
                oStr = "";
                   for(var key in info){
                oStr += "<a href='"+"./"+"?a=Index&amp;c=Index&amp;m=content&amp;mid=25&amp;cid="+info[key]['cid']+"&amp;aid="+info[key]['aid']+"' class='pr'><h3 class='f100'>"+info[key]['title']+"</h3><p class='desc'>"+info[key]['duanmiaoshu']+"</p><span class='b ttu'>more&gt;&gt;</span><img src='"+info[key]['thumb']+"' class='parb'></a>";
                   };
                   $('div.chanpinListBox').append(oStr);
            });
        };
    });
    })();
    </script>
  • 相关阅读:
    Java异常处理和设计
    一次qps测试实践
    Alternate Task UVA
    Just Another Problem UVA
    Lattice Point or Not UVA
    Play with Floor and Ceil UVA
    Exploring Pyramids UVALive
    Cheerleaders UVA
    Triangle Counting UVA
    Square Numbers UVA
  • 原文地址:https://www.cnblogs.com/e0yu/p/7603179.html
Copyright © 2011-2022 走看看