当前位置: 首页 > 图文教程 > 网页制作 > HTML/XHTML教程 > 擦除式图片轮番显示效果

HTML/XHTML教程
showModelessDialog()使用详解
UBB 转换函数演示
用js封装的时间设置器
跟我学XSL(一)
跟我学XSL(二)
深入了解CSS的继承性及其应用
从HTML语言到网上家园 序章
从HTML语言到网上家园 第一章 HTML语言结构
从HTML语言到网上家园 第六章 表单
由显示/隐藏引出的CSS Bug
在因特网上建设自己的家园
主页设计中配色方案的使用(上)
什么是Web设计-Web设计的金字塔
什么是Web设计-为用户设计
什么是Web设计-建设Web站点
什么是Web设计-从纸张到软件
家园更美丽:网页制作秘籍
从菜鸟到准网页设计师
突破网页文字无法复制局限
网页制作超级技巧(一)

HTML/XHTML教程 中的 擦除式图片轮番显示效果


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-04   浏览: 67 ::
收藏到网摘: n/a

加在< head>中

< SCRIPT LANGUAGE="JavaScript">
//more javascript from http://www.smallrain.net
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// 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] = 'jsimg/1.jpg'
Pic = 'jsimg/2.jpg'
Pic = 'jsimg/3.jpg'
Pic = 'jsimg/4.jpg'
Pic = 'jsimg/5.jpg'
Pic = 'jsimg/6.jpg'
Pic = 'jsimg/7.jpg'
Pic = 'jsimg/8.jpg'
Pic = 'jsimg/9.jpg'
Pic = 'jsimg/10.jpg'


// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
< /script>

加在< body>中

< table border="0" cellpadding="0" cellspacing="0">
< tr>
< td id="VU">
< img src="/upload/tech/20091104/20091104153422_5e388103a391daabe3de1d76a6739ccd.jpg" name='SlideShow' width=388 height=415>
< /td>
< /tr>
< /table>