京东商城新品滚动!

2016-07-07 16:12 来源:www.chinab4c.com 作者:ecshop专家



我这个京东商城修改了首页的高和宽,新品上市滚动就出现了出位。不知要在那里修改有知道的请指点下!

修改成这样的滚动http://www.xdzdz.com
我首页商品的尺寸都跟他是一样的。
新品上市recommend_new.lbi 代码如下。
  1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  2. <!-- {if $new_goods} -->



  3. <div id="globalBest" class="globalModule">
  4. <h3>
  5. <div id="recom_title_r">
  6. <div id="recom_title_new">
  7. <a style="color:#005aa0; font-weight:normal; float:right; padding-right:5px;" href="../search.php?intro=new">更多新品>></a>
  8. </div>
  9. </div>
  10. </h3>
  11. <div id="show_new_area" class="itemGrid">


  12. <DIV class=container>
  13. <SCRIPT>
  14. function Marquee()
  15. {
  16. this.ID = document.getElementById(arguments[0]);
  17. this.Direction = arguments[1];
  18. this.Step = arguments[2];
  19. this.Width = arguments[3];
  20. this.Height = arguments[4];
  21. this.Timer = arguments[5];
  22. this.WaitTime = arguments[6];
  23. this.StopTime = arguments[7];
  24. if(arguments[8])
  25. this.ScrollStep = arguments[8]
  26. else
  27. this.ScrollStep = this.Direction>1 ? this.Width : this.Height;
  28. this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
  29. this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
  30. this.ID.noWrap = true;
  31. this.ID.style.width = this.Width;
  32. this.ID.style.height = this.Height;
  33. this.ClientScroll = this.Direction>1 ? this.ID.scrollWidth : this.ID.scrollHeight;
  34. this.ID.innerHTML += this.ID.innerHTML;
  35. this.Start(this,this.Timer,this.WaitTime,this.StopTime);
  36. }


  37. Marquee.prototype.Start = function(msobj,timer,waittime,stoptime)
  38. {
  39. msobj.StartID = function(){msobj.Scroll()}
  40. msobj.Continue = function()
  41. {
  42. if(msobj.MouseOver == 1)
  43. {
  44. setTimeout(msobj.Continue,waittime);
  45. }
  46. else
  47. {clearInterval(msobj.TimerID);
  48. msobj.CTL = msobj.Stop = 0;
  49. msobj.TimerID = setInterval(msobj.StartID,timer);
  50. }
  51. }
  52. msobj.Pause = function()
  53. {
  54. msobj.Stop = 1;
  55. clearInterval(msobj.TimerID);
  56. setTimeout(msobj.Continue,waittime);
  57. }
  58. msobj.Begin = function()
  59. {
  60. msobj.TimerID = setInterval(msobj.StartID,timer);
  61. msobj.ID.onmouseover = function()
  62. {
  63. msobj.MouseOver = 1;
  64. clearInterval(msobj.TimerID);
  65. }
  66. msobj.ID.onmouseout = function()
  67. {
  68. msobj.MouseOver = 0;
  69. if(msobj.Stop == 0)
  70. {
  71. clearInterval(msobj.TimerID);
  72. msobj.TimerID = setInterval(msobj.StartID,timer);
  73. }
  74. }
  75. }
  76. setTimeout(msobj.Begin,stoptime);
  77. }

  78. Marquee.prototype.Scroll = function()
  79. {
  80. switch(this.Direction)
  81. {
  82. case 0:
  83. this.CTL += this.Step;
  84. if(this.CTL >= this.ScrollStep && this.WaitTime > 0)
  85. {
  86. this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
  87. this.Pause();
  88. return;
  89. }
  90. else
  91. {
  92. if(this.ID.scrollTop >= this.ClientScroll)
  93. {
  94. this.ID.scrollTop -= this.ClientScroll;
  95. }
  96. this.ID.scrollTop += this.Step;
  97. }
  98. break;

  99. case 1:
  100. this.CTL += this.Step;
  101. if(this.CTL >= this.ScrollStep && this.WaitTime > 0)
  102. {
  103. this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
  104. this.Pause();
  105. return;
  106. }
  107. else
  108. {
  109. if(this.ID.scrollTop <= 0)
  110. {
  111. this.ID.scrollTop += this.ClientScroll;
  112. }
  113. this.ID.scrollTop -= this.Step;
  114. }
  115. break;

  116. case 2:
  117. this.CTL += this.Step;
  118. if(this.CTL >= this.ScrollStep && this.WaitTime > 0)
  119. {
  120. this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
  121. this.Pause();
  122. return;
  123. }
  124. else
  125. {
  126. if(this.ID.scrollLeft >= this.ClientScroll)
  127. {
  128. this.ID.scrollLeft -= this.ClientScroll;
  129. }
  130. this.ID.scrollLeft += this.Step;
  131. }
  132. break;

  133. case 3:
  134. this.CTL += this.Step;
  135. if(this.CTL >= this.ScrollStep && this.WaitTime > 0)
  136. {
  137. this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
  138. this.Pause();
  139. return;
  140. }
  141. else
  142. {
  143. if(this.ID.scrollLeft <= 0)
  144. {
  145. this.ID.scrollLeft += this.ClientScroll;
  146. }
  147. this.ID.scrollLeft -= this.Step;
  148. }
  149. break;
  150. }
  151. }
  152. -->
  153. </SCRIPT>

  154. <DIV id=textdiv style="height:189px; overflow:hidden">
  155. <DIV id=lr>

  156. <div>
  157. <DIV class="cxtj2" >
  158. <!--滚动开始-->

  159. <!--{foreach from=$new_goods item=goods}-->
  160. <div class="item">
  161. <img style=" float:right" src="../images/item_line.gif">
  162. <p class="pic"><a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" /></a></p>
  163. <p class="name"><a href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.short_style_name}</a></p>

  164. <p class="price">
  165. <!-- {if $goods.promote_price neq ""} -->
  166. {$lang.promote_price}<span class="goodsPrice">{$goods.promote_price}</span>
  167. <!-- {else}-->
  168. {$lang.shop_price}<span class="goodsPrice">{$goods.shop_price}</span>
  169. <!--{/if}-->
  170. </p>

  171. </div>
  172. <!-- {/foreach} -->
  173. <!--滚动结束-->
  174. </DIV>
  175. </div>


  176. </DIV></DIV>
  177. <SCRIPT defer>
  178. if(screen.width<1025)
  179. new Marquee("textdiv",0,4,546,189,1,3000,1)
  180. else
  181. new Marquee("textdiv",0,4,766,189,1,3000,1)
  182. </SCRIPT>


  183. </DIV>



  184. </div>
  185. </div>
  186. <!-- {/if} -->
复制代码
有谁知道的请指点下。谢谢。QQ:8426888

回答:
没发现哪有问题啊

我对了下也没发现那里错误就是滚动不齐!