擦除式图片轮番显示效果

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 liuliu26 的 blog

加在<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[1] = 'jsimg/2.jpg'
pic[2] = 'jsimg/3.jpg'
pic[3] = 'jsimg/4.jpg'
pic[4] = 'jsimg/5.jpg'
pic[5] = 'jsimg/6.jpg'
pic[6] = 'jsimg/7.jpg'
pic[7] = 'jsimg/8.jpg'
pic[8] = 'jsimg/9.jpg'
pic[9] = '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="jsimg/1.jpg" name='slideshow' width=388 height=415>
</td>
</tr>
</table>

效果演示:http://www.smallrain.net/js_show.asp?id=669

本文关键:渐隐渐显
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top