找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 1281|回复: 13

如何写图片广告上下翻动的代码?

[复制链接]
发表于 2007 年 1 月 2 日 23:33:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
一行8 个图片,5秒钟后上翻显示另外8个图片,5秒钟后下翻显示另外8个图片,如此循环,共有5组图片,

客户要求作这样的效果,我想破头也没写出来,救命!
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
发表于 2007 年 1 月 2 日 23:35:06 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
flash偶就知道怎么做!java就不晓得了
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 1 月 2 日 23:36:18 | 显示全部楼层
呵呵。。下个JS看下。。如何实现的
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 1 月 2 日 23:36:59 | 显示全部楼层
看看http://bbs.163.com有个效果可以仿照的
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2007 年 1 月 2 日 23:38:03 | 显示全部楼层
我要找的就是JavaScript的
或者做个FLASH的能读取外部图片的?
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 1 月 2 日 23:41:52 | 显示全部楼层
163的哪个
  1. <div class="list">
  2. <div class="num">
  3. <ul>
  4. <li><img src="http://cimg2.163.com/cnews/newimg/bbs/up.gif" alt=" " id="upbtn" style="cursor: pointer;" onclick="slideup();clearInterval(interval01);" onfocus="this.blur()" height="15" width="35"></li>
  5. <li class="num1" id="led1">01</li>
  6. <li class="num1" id="led2">02</li>
  7. <li class="num2" id="led3">03</li>
  8. <li><img src="http://cimg2.163.com/cnews/newimg/bbs/down.gif" alt=" " id="downbtn" style="cursor: pointer; display: none;" onclick="slidedown();clearInterval(interval01);" onfocus="this.blur()" height="15" width="35"></li>
  9. </ul>
  10. </div>
  11. <script language="javascript">
  12. var checkloaded=new Array();
  13. for(i=1;i<=3;i++){
  14. checkloaded[i]=0;
  15. }
  16. function checkdamie(n){
  17.         checkloaded[n]=1;
  18.         //alert(checkloaded[n])
  19. }
  20. </script>
  21. <div class="picList" id="main" style="overflow: hidden; width: 470px; height: 125px; position: relative;" nowrap="true" onmouseover="clearInterval(interval01);" onmouseout="iniautoslide();">

  22. <div id="f1" style="position: absolute; width: 470px; height: 125px; z-index: 10; left: 0px; top: 0px; display: block;">
  23. <script>checkdamie(1);</script>
  24. <ul>
  25. <li><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1958952"><img src="http://cimg2.163.com/cnews/2007/1/2/2007010212071236fe0.jpg" alt="网吧惊现美女作陪上网" border="0" height="80" width="130"></a>
  26.   <h5><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1958952">网吧惊现美女作陪上网</a></h5>
  27. </li>
  28. <li><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1960457"><img src="http://cimg2.163.com/cnews/2007/1/2/200701021205124851d.jpg" alt="盘点06中国十大疯子" border="0" height="80" width="130"></a>
  29.   <h5><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1960457">盘点06中国十大疯子</a></h5>
  30. </li>
  31. <li><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1956779"><img src="http://cimg2.163.com/cnews/2007/1/1/2007010111201618644.jpg" alt="北大女生PK金庸" border="0" height="80" width="130"></a>
  32.   <h5><a href="http://bbs3.news.163.com/board/rep.jsp?b=photo&amp;i=1956779">北大女生PK金庸</a></h5>

  33. </li>
  34. </ul>
  35. </div>
  36. <div id="f2" style="display: block; position: absolute; width: 470px; height: 125px; z-index: 10; left: 0px; top: 125px;">
  37. <script>checkdamie(2);</script>
  38. <ul>
  39. <li><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1215341"><img src="http://220.181.29.172/boardfile/banzhu/20071/20070101222659.jpg" alt="世界十大反恐怖部队" border="0" height="80" width="130"></a>
  40.   <h5><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1215341">世界十大反恐怖部队</a></h5>
  41. </li>
  42. <li><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1211328"><img src="http://220.181.29.172/boardfile/banzhu/20071/20070101222155.jpg" alt="中国陆海空军衔大全" border="0" height="80" width="130"></a>
  43.   <h5><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1211328">中国陆海空军衔大全</a></h5>
  44. </li>

  45. <li><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1214486"><img src="http://220.181.29.172/boardfile/banzhu/20071/20070101084328.jpg" alt="06年军事演习精华回顾" border="0" height="80" width="130"></a>
  46.   <h5><a href="http://bbs.news.163.com/board/rep.jsp?b=mil&amp;i=1214486">06年军事演习精华回顾</a></h5>
  47. </li>
  48. </ul>
  49. </div>
  50. <div id="f3" style="display: block; position: absolute; width: 470px; height: 125px; z-index: 10; left: 0px; top: 250px;">
  51. <script>checkdamie(3);</script>
  52. <ul>
  53. <li><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1092823"><img src="http://cimg2.163.com/cnews/2007/1/2/20070102124423facca.jpg" alt="艺术品一样的女性用品" border="0" height="80" width="130"></a>
  54.   <h5><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1092823">艺术品一样的女性用品</a></h5>
  55. </li>
  56. <li><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1129887"><img src="http://cimg2.163.com/cnews/2007/1/2/2007010212425378300.jpg" alt="非常酷的书包" border="0" height="80" width="130"></a>

  57.   <h5><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1129887">非常酷的书包</a></h5>
  58. </li>
  59. <li><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1125699"><img src="http://cimg2.163.com/cnews/2007/1/1/20070101113335b27a0.jpg" alt="见到美女时的经典表情" border="0" height="80" width="130"></a>
  60.   <h5><a href="http://bbs6.news.163.com/board/rep.jsp?b=happy&amp;i=1125699">见到美女时的经典表情</a></h5>
  61. </li>
  62. </ul>
  63. </div>
  64. </div>
  65. <script language="JavaScript">
  66. <!--
  67. var currentF=1;
  68. document.getElementById("upbtn").style.display="none";
  69. var mainobj = document.getElementById("main");
  70. var frameheight =125;
  71. var scrolling=0;
  72. var speed = 20;
  73. function alertloading(sdirection){
  74. scrolling=0;
  75. if(sdirection == "down"){
  76. currentF--;
  77. }
  78. else{
  79. currentF++;
  80. }
  81. }
  82. function scrolldown(f){
  83.         switch (f){
  84.         case 2:
  85.         if (mainobj.scrollTop>=frameheight){
  86.                 clearInterval(inter);
  87.                 mainobj.scrollTop=frameheight;
  88.                 scrolling=0;
  89.                 }
  90.         else{mainobj.scrollTop+=speed;}
  91.         break;
  92.         case 3:
  93.         if (mainobj.scrollTop>=frameheight*2){
  94.                 mainobj.scrollTop=frameheight*2;
  95.                 clearInterval(inter);
  96.                 scrolling=0;
  97.                 }
  98.         else{mainobj.scrollTop+=speed;}
  99.         break;
  100.         }
  101. }
  102. function scrollup(f){
  103.         switch (f){
  104.         case 1:
  105.         if (mainobj.scrollTop<=0){
  106.                 clearInterval(inter1);
  107.                 mainobj.scrollTop=0;
  108.                 scrolling=0;
  109.                 }
  110.         else{
  111.         mainobj.scrollTop-=speed;
  112.         }
  113.         break;
  114.         case 2:
  115.         if (mainobj.scrollTop<=frameheight){
  116.                 mainobj.scrollTop=frameheight;
  117.                 clearInterval(inter1);
  118.                 scrolling=0;
  119.                 }
  120.         else{
  121.         mainobj.scrollTop-=speed;
  122.         }
  123.         break;
  124.         }
  125. }
  126. function slidedown(){
  127. if (scrolling==0){
  128.         scrolling=1;
  129.         currentF++;
  130.         obj=eval("document.getElementById('f"+currentF+"')");
  131.         obj.style.display="block";
  132.         if (checkloaded[currentF]==1){
  133.                 inter=eval("setInterval('scrolldown("+currentF+")',5)");
  134.                 document.getElementById("upbtn").style.display="";
  135.                 if (currentF==3){
  136.                 document.getElementById("downbtn").style.display="none";
  137.                 }
  138.                 for (i=1;i<=3;i++){
  139.                 eval("document.getElementById('led"+i+"').className='num1'");
  140.                 }
  141.                 eval("document.getElementById('led"+currentF+"').className='num2'");
  142.         }
  143.         else{
  144.         alertloading("down");
  145.        
  146.         }
  147.         }
  148. }
  149. function slideup(){
  150.         //slide
  151. if (scrolling==0){
  152.         scrolling=1;
  153.         currentF--;
  154.         obj=eval("document.getElementById('f"+currentF+"')");
  155.         obj.style.display="block";
  156.                 if (checkloaded[currentF]==1){
  157.                 inter1=eval("setInterval('scrollup("+currentF+")',5)");
  158.                 //led
  159.                 document.getElementById("downbtn").style.display="";
  160.                 if (currentF==1){
  161.                 document.getElementById("upbtn").style.display="none";
  162.                 }
  163.                 for (i=1;i<=3;i++){
  164.                 eval("document.getElementById('led"+i+"').className='num1'");
  165.                 }
  166.                 eval("document.getElementById('led"+currentF+"').className='num2'");
  167.                 }
  168.                 else{
  169.                 alertloading("up");
  170.                 }
  171.         }
  172. }
  173. //auto slide
  174. var direction = "down";
  175. var interval01;
  176. var autotime = 8000;
  177. function autoslide(){
  178.         if(direction == "down"){
  179.                 if (currentF == 2){
  180.                  direction = "up";
  181.                 }
  182.         slidedown();
  183.         }
  184.         if(direction == "up"){
  185.                 if (currentF == 2){
  186.                  direction = "down";
  187.                 }
  188.         slideup();
  189.         }
  190.        
  191. }
  192. function iniautoslide(){
  193. interval01 = setInterval("autoslide()",autotime);
  194. }
  195. //-->
  196. </script>
  197. </div>
复制代码
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 1 月 2 日 23:49:53 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
不错,就是这个
不过要改写下
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2007 年 1 月 2 日 23:51:18 | 显示全部楼层
楼上的FF好像不能用:(
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 1 月 3 日 00:01:59 | 显示全部楼层
flash不就很简单实现了吗?
你要是不闲麻烦的话
用fireworks也可以轻松实现啊
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2007 年 1 月 3 日 19:36:07 | 显示全部楼层
用fireworks如何轻松实现啊
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 4 日 19:07 , Processed in 0.045385 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表