css实现缩略图鼠标移上去显示大图 » « 一个不间断横向滚动代码

一个公告滚动效果

一个公告滚动效果

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <title>一个公告滚动效果</title>
  5. <style type="text/css">
  6. <!--
  7. body {
  8. background-color: #000033;
  9. }
  10. -->
  11. </style></head>
  12. <body>
  13. <table width="728" border="0" align="center" cellpadding="0" cellspacing="0">
  14. <tr>
  15. <td width="989"><div id=icefable1>
  16. <table width="728" border="0" cellpadding="0" cellspacing="0">
  17. <tr>
  18. <td width="728" height="60" bgcolor="#0099CC">1</td>
  19. </tr>
  20. <tr>
  21. <td height="60" bgcolor="#00FFCC">2</td>
  22. </tr>
  23. <tr>
  24. <td height="60" bgcolor="#99FF00">3</td>
  25. </tr>
  26. <tr>
  27. <td height="60" bgcolor="#00CCFF">4</td>
  28. </tr>
  29. <tr>
  30. <td height="60" bgcolor="#FF9900">5</td>
  31. </tr>
  32. <tr>
  33. <td height="60" bgcolor="#FFFF33">6</td>
  34. </tr>
  35. </table>
  36. <script>
  37. marqueesHeight=60;
  38. stopscroll=false;
  39. with(icefable1){
  40. style.width=0;
  41. style.height=marqueesHeight;
  42. style.overflowX="visible";
  43. style.overflowY="hidden";
  44. noWrap=true;
  45. onmouseover=new Function("stopscroll=true");
  46. onmouseout=new Function("stopscroll=false");
  47. }
  48. preTop=0; currentTop=marqueesHeight; stoptime=0;
  49. icefable1.innerHTML+=icefable1.innerHTML;
  50. function init_srolltext(){
  51. icefable1.scrollTop=0;
  52. setInterval("scrollUp()",1);
  53. }init_srolltext();
  54. function scrollUp(){
  55. if(stopscroll==true) return;
  56. currentTop+=1;
  57. if(currentTop==marqueesHeight+1)
  58. {
  59. stoptime+=1;
  60. currentTop-=1;
  61. if(stoptime==300)
  62. {
  63. currentTop=0;
  64. stoptime=0;
  65. }
  66. }
  67. else {
  68. preTop=icefable1.scrollTop;
  69. icefable1.scrollTop+=1;
  70. if(preTop==icefable1.scrollTop){
  71. icefable1.scrollTop=marqueesHeight;
  72. icefable1.scrollTop+=1;
  73. }
  74. }
  75. }
  76. init_srolltext();
  77. </script>
  78. </div>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td height="145" bgcolor="#0066FF"> </td>
  83. </tr>
  84. </table>
  85. </body>
  86. </html>

标签:

阅读该文章的读者还阅读了: 您也可以阅读与此文相关的文章: 看看还有没有其他您感兴趣的文章:

想说点什么吗?

引用通告 RSS订阅评论

我要评论