百转千回,万物皆变心不动,任清风自流。

html,css,jQuery,javascript,php,mysql,dedecms,phpcms,wordpress,linux,windows
  首页  :: 订阅 订阅  :: 管理

无数字纯JS图片切换

Posted on 2012-05-09 08:38  李潇喃  阅读(164)  评论(0)    收藏  举报
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script language=JavaScript> <!-- // 设置轮番显示速度 Set slideShowSpeed (milliseconds) var slideShowSpeed = 3000; // 匀滑转换时间 Duration of crossfade (seconds) var crossFadeDuration = 3; // 指定图像文件 Specify the image files var Pic = new Array(); // to add more images, just continue // the pattern, adding to the array below Pic[0] = 'img_33.jpg' Pic[1] = 'img_31.jpg' // do not edit anything below this line var j = 0; var preLoad = new Array(); for (i = 0; i < Pic.length; i++) { preLoad[i] = new Image(); preLoad[i].src = Pic[i]; } function runSlideShow() { var SlideShow =document.getElementById("SlideShow"); SlideShow.style.filter="blendTrans(duration=2)"; SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"; if(SlideShow.filters){SlideShow.filters.blendTrans.Apply();} SlideShow.src = preLoad[j].src; if(SlideShow.filters){SlideShow.filters.blendTrans.Play();} j = j + 1; if (j > (Pic.length - 1)) j = 0; setTimeout('runSlideShow()', slideShowSpeed); } --> </script> </head> <body> <img src="img_30.jpg" height="160" width="140" id=SlideShow> <script language=JavaScript> <!-- runSlideShow(); //--> </script> </body> </html>