Tip: you can modify some code before running
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Image switching</title></head><body><style type="text/css"># Img1 {position: absolute; width: 140px; height: 105px; left: 220px; top: 125px; z-index: 1; visibility: hidden;} # img2 {position: absolute; width: 140px; height: 105px; left: 220px; top: 125px; z-index: 2}</style><SCRIPT LANGUAGE="JavaScript"><!-- Beginvar ie5=(document.getElementById && document.all);var ns6=(document.getElementById && !document.all);nPlus = 5 //the % of fading for each stepspeed = 50 //速度// You don't have to edit below this linenOpac = 100function FadeImg(){ if(document.getElementById){ document.getElementById('img1').style.visibility="visible"; imgs = document.getElementById('img2');opacity = nOpac+nPlus;nOpac = opacity;setTimeout('FadeImg()',speed); if(opacity>100 || opacity<0){ nPlus=-nPlus; } if(ie5){ imgs.style.filter="alpha(opacity=0)";imgs.filters.alpha.opacity = opacity; } if(ns6){ imgs.style.MozOpacity = 0 + '%';imgs.style.MozOpacity = opacity + '%'; } }}onload=FadeImg;// End --></script><div id="img1"> </div><div id="img2"> </div></body></html>
Tip: you can modify some code before running