找回密码
 加入
搜索

[代码] 非FLASH幻灯片代码

[复制链接]
发表于 2009-2-23 11:55:22 | 显示全部楼层 |阅读模式
  1. <style type="text/css">

  2. /* 数字按钮框样式 */
  3. #imgTitle {FILTER:ALPHA(opacity=70);position:relative;left:0px;text-align:left;overflow:

  4. hidden;}
  5. #imgTitle_up {left:0px;text-align: left; height:1px; width:inherit; }
  6. #imgTitle_down {left:0px;text-align: right; width:inherit; }
  7. /* 图片框样式 */
  8. .imgClass {border: 0px solid #000;}
  9. /* 图片文字框样式 */
  10. #txtFrom {text-align: center;vertical-align: middle;}
  11. /* 数字按钮样式 */
  12. .button {text-decoration: none;padding: 2px 7px;background: #7B7B63;margin: 0px;font: bold

  13. 9px sans-serif; border-left:#fff 1px solid;}
  14. a.button, a.button:link, a.button:visited {font-family: sans-serif;text-decoration:

  15. none;color:#FFFFFF;background-color: #000000;}
  16. a.button:hover {font-family: sans-serif;text-decoration: none;color:#fff;background:#fff; }
  17. .buttonDiv {background: #000000;height: 1px;width: 21px;float: left;text-align: center;

  18. vertical-align: middle;}
  19. /*渐变*/
  20. .trans { width:90px; background-color:#000;filter : progid:DXImageTransform.Microsoft.Alpha

  21. (startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40);}

  22. </style><script language="javascript" type="text/javascript">
  23. var imgWidth=365; //图片宽
  24. var imgHeight=227; //图片高
  25. var textFromHeight=20; //焦点字框高度 (单位为px)
  26. var textStyle="f12"; //焦点字class style (不是连接class)
  27. var textLinkStyle="p1"; //焦点字连接class style
  28. var buttonLineOn="#f60"; //button下划线on的颜色
  29. var buttonLineOff="#000"; //button下划线off的颜色
  30. var TimeOut=5000; //每张图切换时间 (单位毫秒);
  31. var imgUrl=new Array();
  32. var imgLink=new Array();
  33. var imgtext=new Array();
  34. var imgAlt=new Array();
  35. var adNum=0;
  36. //焦点字框高度样式表 开始
  37. document.write('<style type="text/css">');
  38. document.write('#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+

  39. (imgHeight+textFromHeight)+'px; overflow:hidden;}');
  40. document.write('#txtFrom{height:'+textFromHeight+'px;line-

  41. height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
  42. document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+16)+'px;height:18px}');
  43. document.write('</style>');
  44. document.write('<div id="focuseFrom">');
  45. //焦点字框高度样式表 结束

  46. imgUrl[1]='http://www.lemuria.com.cn/upload/h/n/l/x/hnlx.xuntan.com/forum/2007-

  47. 07/1184380150456513.jpg';
  48. imgtext[1]='<A HREF="http://www.lemuria.com.cn15-1-16-0-0-0.html" TARGET="_blank"

  49. class="'+textLinkStyle+'">禧玛妹妹,一个河南打工妹网络故事</A>';
  50. imgLink[1]='http://www.lemuria.com.cn15-1-16-0-0-0.html';
  51. imgAlt[1]='禧玛妹妹,一个河南打工妹网络故事';

  52. imgUrl[2]='http://www.lemuria.com.cn/upload/h/n/l/x/hnlx.xuntan.com/forum/2007-

  53. 07/1184382642363590.jpg';
  54. imgtext[2]='<A HREF="http://www.lemuria.com.cn15-1-19-0-0-0.html" TARGET="_blank"

  55. class="'+textLinkStyle+'">中国最美乡村女教师</A>';
  56. imgLink[2]='http://www.lemuria.com.cn15-1-19-0-0-0.html ';
  57. imgAlt[2]='中国最美乡村女教师';

  58. imgUrl[3]='http://www.lemuria.com.cn/upload/h/n/l/x/hnlx.xuntan.com/forum/2007-

  59. 08/1185939057101179.jpg';
  60. imgtext[3]='<A HREF="http://www.lemuria.com.cn9-1-29-0-0-0.html" TARGET="_blank"

  61. class="'+textLinkStyle+'">发美女,看吧!</A>';
  62. imgLink[3]='http://www.lemuria.com.cn9-1-29-0-0-0.html';
  63. imgAlt[3]='发美女,看吧!';

  64. imgUrl[4]='http://www.lemuria.com.cn/upload/h/n/l/x/hnlx.xuntan.com/forum/2007-

  65. 07/1185526463170922.jpg';
  66. imgtext[4]='<A HREF="http://www.lemuria.com.cn19-1-25-0-0-0.html" TARGET="_blank"

  67. class="'+textLinkStyle+'">变形金刚</A>';
  68. imgLink[4]='http://www.lemuria.com.cn19-1-25-0-0-0.html';
  69. imgAlt[4]='变形金刚';

  70. function changeimg(n)
  71. {
  72. adNum=n;
  73. window.clearInterval(theTimer);
  74. adNum=adNum-1;
  75. nextAd();
  76. }
  77. function goUrl(){
  78. window.open(imgLink[adNum],'_blank');
  79. }
  80. //NetScape开始
  81. if (navigator.appName == "Netscape")
  82. {
  83. document.write('<style type="text/css">');
  84. document.write('.buttonDiv{height:4px;width:21px;}');
  85. document.write('</style>');
  86. function nextAd(){
  87. if(adNum<(imgUrl.length-1))adNum++;
  88. else adNum=1;
  89. theTimer=setTimeout("nextAd()", TimeOut);
  90. document.images.imgInit.src=imgUrl[adNum];
  91. document.images.imgInit.alt=imgAlt[adNum];
  92. document.getElementById('focustext').innerHTML=imgtext[adNum];
  93. document.getElementById('imgLink').href=imgLink[adNum];

  94. }
  95. document.write('<a id="imgLink" href="'+imgLink[1]+'" target=_blank class="p1"><img

  96. src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=1

  97. alt="'+imgAlt[1]+'" class="imgClass"></a><div id="txtFrom"><span id="focustext"

  98. class="'+textStyle+'">'+imgtext[1]+'</span></div>')
  99. document.write('<div id="imgTitle">');
  100. document.write('<div id="imgTitle_down">');
  101. //数字按钮代码结束
  102. document.write('</div>');
  103. document.write('</div>');
  104. document.write('</div>');
  105. nextAd();
  106. }
  107. //NetScape结束
  108. //IE开始
  109. else
  110. {
  111. var count=0;
  112. for (i=1;i<imgUrl.length;i++) {
  113. if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="") ) {
  114. count++;
  115. } else {
  116. break;
  117. }
  118. }
  119. function playTran(){
  120. if (document.all)
  121. imgInit.filters.revealTrans.play();
  122. }
  123. var key=0;
  124. function nextAd(){
  125. if(adNum<count)adNum++ ;
  126. else adNum=1;

  127. if( key==0 ){
  128. key=1;
  129. } else if (document.all){
  130. imgInit.filters.revealTrans.Transition=6;
  131. imgInit.filters.revealTrans.apply();
  132. playTran();
  133. }
  134. document.images.imgInit.src=imgUrl[adNum];
  135. document.images.imgInit.alt=imgAlt[adNum];
  136. document.getElementById('link'+adNum).style.background=buttonLineOn;
  137. for (var i=1;i<=count;i++)
  138. {
  139. if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
  140. }
  141. focustext.innerHTML=imgtext[adNum];
  142. theTimer=setTimeout("nextAd()", TimeOut);
  143. }
  144. document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans

  145. (duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+'

  146. height='+imgHeight+' border=0 vspace="0" name=imgInit class="imgClass"></a>');
  147. document.write('<div id="txtFrom"><span id="focustext"

  148. class="'+textStyle+'"></span></div>');
  149. document.write('<div id="imgTitle">');
  150. document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
  151. //数字按钮代码开始
  152. for(var i=1;i<imgUrl.length;i++){document.write('<a id="link'+i+'"

  153. href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'"

  154. onFocus="this.blur()">'+i+'</a>');}
  155. //数字按钮代码结束
  156. document.write('</div>');
  157. document.write('</div>');
  158. document.write('</div>');
  159. }
  160. //IE结束
  161. </script>
复制代码
 楼主| 发表于 2009-2-23 11:57:09 | 显示全部楼层
FLASH幻灯片代码
  1. <script type="text/javascript">
  2. var swf_width=266
  3. var swf_height=252
  4. var files="http://www.lemuria.com.cn/images/banner_180x250_tjyj.jpg|/hbcms/upload/image/big/f0/f02d876834758019e5c7ce6a8febd72d.jpg"
  5. var links="http://www.lemuria.com.cn"
  6. var texts="全民动员抵制日货"
  7. document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
  8. document.write('<param name="movie" value="img1.swf" /><param name="quality" value="high" />');
  9. document.write('<param name="menu" value="false" /><param name=wmode value="opaque" />');
  10. document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
  11. document.write('<embed src="img1.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  12. document.write('</object>');
  13. </script>
复制代码
 楼主| 发表于 2009-2-23 11:59:31 | 显示全部楼层
天极网的javascript图片滚动效果代码
  1. <!--焦点滚动图开始-->
  2. <div class="y_ijdpic" id="__index002">
  3. <SCRIPT>                    
  4. var widths=282;                    
  5. var heights=164;                    
  6. var counts=5;   
  7. var urls =new Array();
  8. img1=new Image ();img1.src='http://www.yesky.com/imagelist/06/03/b6o3b53xuuat.jpg';
  9. img2=new Image ();img2.src='http://www.yesky.com/imagelist/2007/234/6954vuk092po.jpg';  
  10. img3=new Image ();img3.src='http://www.yesky.com/imagelist/2007/236/8x8060d9e76h.jpg';
  11. img4=new Image ();img4.src='http://www.yesky.com/imagelist/2007/236/3p3b0964ax99.jpg';
  12. img5=new Image ();img5.src='http://www.yesky.com/imagelist/2007/236/gc9kkrk1n1kr.jpg';
  13. urls[1]='http://bj.yesky.com/bjfocus/367/3495867.shtml';
  14. urls[2]='http://www.mydown.com/zhuanti/349/432349.shtml';   
  15. urls[3]='http://gamepic.yesky.com/gamepic/yxzhuanti/426/509426.shtml';   
  16. urls[4]='http://notebook.yesky.com/notebookkpzt/246/7510746.shtml';
  17. urls[5]='http://notebook.yesky.com/notebookkpzt/391/3425391.shtml';
  18. </SCRIPT>
  19. <SCRIPT src="http://image2.yesky.com/TLimages/include/product/focus1.js"></SCRIPT>
  20. </div>
  21. <!--焦点滚动图结束-->
复制代码

Archiver|手机版|小黑屋|乱弹琴|重庆网址之家|多来米发 |

GMT+8, 2026-10-13 07:42 PM

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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