[付费]找人帮搞京东促销倒计时功能

2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家



有帮忙的请加Q38339902价钱详谈,验证请注明:ECSHOP

回答:
你在论坛找把。有相似的。

lefttime.js这个文件不可以实现吗
  1. /* $Id : lefttime.js 4865 2007-01-31 14:04:10Z paulgao $ */

  2. /* *
  3. * 给定一个剩余时间(s)动态显示一个剩余时间.
  4. * 当大于一天时。只显示还剩几天。小于一天时显示剩余多少小时,多少分钟,多少秒。秒数每秒减1 *
  5. */

  6. // 初始化变量
  7. var auctionDate = 0;
  8. var _GMTEndTime = 0;
  9. var showTime = "leftTime";
  10. var _day = '天';
  11. var _hour = '时';
  12. var _minute = '分';
  13. var _second = '秒';
  14. var _end = 'end';

  15. var cur_date = new Date();
  16. var startTime = cur_date.getTime();
  17. var Temp;
  18. var timerID = null;
  19. var timerRunning = false;

  20. function showtime()
  21. {
  22. now = new Date();
  23. var ts = parseInt((startTime - now.getTime()) / 1000) + auctionDate;
  24. var dateLeft = 0;
  25. var hourLeft = 0;
  26. var minuteLeft = 0;
  27. var secondLeft = 0;
  28. var hourZero = '';
  29. var minuteZero = '';
  30. var secondZero = '';
  31. if (ts < 0)
  32. {
  33. ts = 0;
  34. CurHour = 0;
  35. CurMinute = 0;
  36. CurSecond = 0;
  37. }
  38. else
  39. {
  40. dateLeft = parseInt(ts / 86400);
  41. ts = ts - dateLeft * 86400;
  42. hourLeft = parseInt(ts / 3600);
  43. ts = ts - hourLeft * 3600;
  44. minuteLeft = parseInt(ts / 60);
  45. secondLeft = ts - minuteLeft * 60;
  46. }

  47. if (hourLeft < 10)
  48. {
  49. hourZero = '0';
  50. }
  51. if (minuteLeft < 10)
  52. {
  53. minuteZero = '0';
  54. }
  55. if (secondLeft < 10)
  56. {
  57. secondZero = '0';
  58. }

  59. if (dateLeft > 0)
  60. {
  61. // Temp = dateLeft + _day + hourZero + hourLeft + _hour + minuteZero + minuteLeft + _minute + secondZero + secondLeft + _second;
  62. Temp = dateLeft +_day+''+hourZero + hourLeft+':'+minuteZero + minuteLeft+':'+ secondZero + secondLeft;

  63. }
  64. else
  65. {
  66. if (hourLeft > 0)
  67. {
  68. Temp = hourLeft +':' + minuteZero + minuteLeft +':' + secondZero + secondLeft;

  69. }
  70. else
  71. {
  72. if (minuteLeft > 0)
  73. {
  74. Temp = minuteLeft +':' + secondZero + secondLeft;
  75. }
  76. else
  77. {
  78. if (secondLeft > 0)
  79. {
  80. Temp = secondLeft;
  81. }
  82. else
  83. {
  84. Temp = '';
  85. }
  86. }
  87. }
  88. }

  89. if (auctionDate <= 0 || Temp == '')
  90. {
  91. Temp = "<strong>" + _end + "</strong>";
  92. stopclock();
  93. }

  94. if (document.getElementById(showTime))
  95. {
  96. document.getElementById(showTime).innerHTML = Temp;
  97. }

  98. timerID = setTimeout("showtime()", 1000);
  99. timerRunning = true;
  100. }

  101. var timerID = null;
  102. var timerRunning = false;
  103. function stopclock()
  104. {
  105. if (timerRunning)
  106. {
  107. clearTimeout(timerID);
  108. }
  109. timerRunning = false;
  110. }

  111. function macauclock()
  112. {
  113. stopclock();
  114. showtime();
  115. }

  116. function onload_leftTime(now_time)
  117. {
  118. /* 第一次运行时初始化语言项目 */
  119. try
  120. {
  121. _GMTEndTime = gmt_end_time;
  122. // 剩余时间
  123. _day = day;
  124. _hour = hour;
  125. _minute = minute;
  126. _second = second;
  127. _end = end;
  128. }
  129. catch (e)
  130. {
  131. }
  132. if (_GMTEndTime > 0)
  133. {
  134. if (now_time == undefined)
  135. {
  136. var tmp_val = parseInt(_GMTEndTime) - parseInt(cur_date.getTime() / 1000 + cur_date.getTimezoneOffset() * 60);
  137. }
  138. else
  139. {
  140. var tmp_val = parseInt(_GMTEndTime) - now_time;
  141. }
  142. if (tmp_val > 0)
  143. {
  144. auctionDate = tmp_val;
  145. }
  146. }

  147. macauclock();
  148. try
  149. {
  150. initprovcity();
  151. }
  152. catch (e)
  153. {
  154. }
  155. }
复制代码

这是我之前的修改

ecshop 二次开发 模板制作


010-81119151QQ:260767000

楼上见缝插针呐,嘿嘿~~

楼主贴出的问题 大家能把具体的解决方案贴出来吗谢谢啦急急急