index.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <{include file="header.html"}>
  2. <style>
  3. .vogue_top_list img {
  4. background: #fff url("<{$web_cfg.cdn}>/public/static/img/m-load.gif") no-repeat scroll 50% center / 20px 20px;
  5. }
  6. </style>
  7. <{include file="common_header.html"}>
  8. <div class="wrapper clear">
  9. <div class="vogue_top_list">
  10. <{foreach from=$eventsData item=events}>
  11. <dl>
  12. <a href="<{$events.url}>">
  13. <dt><img src="<{$web_cfg.cdn}>/public/static/img/bg_alpha.png" data-ks-lazyload="<{$events.img_url}>"></dt>
  14. <dd>
  15. <p><{$events.events_name}></p>
  16. <p class="v_time">
  17. <{if $events.rday>=1}>
  18. <em class="time_icon"></em><span>剩余<{$events.rday}>天</span>
  19. <{else}>
  20. 已结束
  21. <{/if}>
  22. </p>
  23. </dd>
  24. </a>
  25. </dl>
  26. <{/foreach}>
  27. </div>
  28. <div class="clear"></div>
  29. <{if $totals}>
  30. <div class="loading">
  31. <img
  32. id="loadPage"
  33. data-ks-lazyload="<{$web_cfg.cdn}>/public/static/img/loading_new.gif"
  34. data-request-url="<{$web_cfg.domain}>/?c=index&a=ajax&plat_form_id=<{$plat_form_id}>&url=<{$url}>"
  35. data-page="2"
  36. data-totals="<{$totals}>"
  37. style="width:0px;"
  38. />
  39. <div class="loader-inner ball-pulse">
  40. <div></div><div></div><div></div><div></div><div></div><div></div>
  41. </div>
  42. </div>
  43. <{/if}>
  44. <br>
  45. </div>
  46. <!--loading 样式1-->
  47. <!--<div class="loading">
  48. <div class="loader-inner line-spin-fade-loader">
  49. <div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
  50. </div>
  51. </div>-->
  52. <!--loading 样式2-->
  53. <!--<div class="loading">
  54. <div class="loader-inner ball-pulse">
  55. <div></div><div></div><div></div><div></div><div></div><div></div>
  56. </div>
  57. </div>-->
  58. <script>
  59. KISSY.use('node, io, gallery/datalazyload/2.0/index', function (S, Node, IO, Datalazyload) {
  60. var $ = S.all;
  61. var lock = false;
  62. new Datalazyload({
  63. load: function(el){
  64. if (lock) return false;
  65. lock = true;
  66. var requesrUrl = $(el).attr('data-request-url');
  67. var page = Number($(el).attr('data-page'));
  68. var totals = Number($(el).attr('data-totals'));
  69. if (!requesrUrl) {
  70. lock = false;
  71. return false;
  72. }
  73. if (page > totals) {
  74. $('.loading').hide();
  75. return false;
  76. }
  77. IO.get(
  78. requesrUrl
  79. , {page: page}
  80. , function (data) {
  81. if (data.ok) {
  82. var next_page = page + 1;
  83. $('#loadPage').attr('data-page', next_page);
  84. var new_dl = $(data.msg);
  85. $(".vogue_top_list").append(new_dl);
  86. //new Datalazyload();
  87. lock = false;
  88. if (next_page > totals) {
  89. $('.loading').hide();
  90. }
  91. }
  92. }
  93. , 'json'
  94. );
  95. }
  96. });
  97. });
  98. //判断当前页图片加载完成loading消失
  99. /* $(".vogue_top_list").find("img").load(function(){
  100. $(this).parent().css("background","none");
  101. }); */
  102. </script>
  103. <{include file="bottom.html"}>