2006/02/21 | 不断变化的网页背景-滤镜效果切换
类别(WEB相关) | 评论(0) | 阅读(303) | 发表于 15:40
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>不断变化的网页背景</title>
<Script>
var backgroundimage=new Array("1.jpg","2.jpg","4.jpg");
var swapspeed=2;
var timer;
var imgpreload=new Array();
if (document.all) {
for (i=0;i<=backgroundimage.length-1;i++) {
imgpreload=new Image();
imgpreload.src=backgroundimage;
}
}
var i_backgroundimage=0;
swapspeed=swapspeed*1000;
function setTransition(){
document.getElementById("id_body").filters.revealTrans.transition=Math.floor(Math.random()*23);
document.getElementById("id_body").filters.revealTrans.apply();
//bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
//bannerADrotator.filters.revealTrans.apply();
}
function playTransition(){
document.getElementById("id_body").filters.revealTrans.play();
//bannerADrotator.filters.revealTrans.play()
}
function swapimages() {
if (document.all) {
window.status=i_backgroundimage;
  setTransition();
document.body.background=backgroundimage[i_backgroundimage];
  playTransition();
i_backgroundimage++;
if (i_backgroundimage>=backgroundimage.length) {i_backgroundimage=0}
timer=setTimeout("swapimages()",swapspeed) ;
}
}
window.onload=swapimages;
</Script>
<body id="id_body" style="FILTER: revealTrans(duration=2,transition=20)">
<marquee>abcabcabcabcabcabc</marquee>
</body>
</html>
0

评论Comments