Bildfade
Exempel
Script
<div style="height:209px;width:192px;">
<div id="fadea" style="position:absolute;visibility:hidden;"><img src="images/onscreen.jojoxx.gif" width="192" height="209" alt="Fade"/></div>
<div id="fadeb" style="position:absolute;visibility:hidden;"><img src="images/onscreen.google.gif" width="192" height="209" alt="Fade"/></div>
<div id="fadec" style="position:absolute;visibility:hidden;"><img src="images/onscreen.yahoo.gif" width="192" height="209" alt="Fade"/></div>
</div>
<script type="text/javascript">
/* The code contained in this file is copyrighted by www.jojoxx.net
The file may be used for none commercial applications and distributed
as long as these lines remain intact. The file or part of it may not
be sold or included in any other commercial application without
agreement from the author. If you have questions or comments, contact
the author at http://www.jojoxx.net
© Copyright - www.jojoxx.net - 2004 */
var divs=["fadea","fadeb","fadec"];
var zindex=0;
function fade(n,diff,opacity){
id=divs[n];
opacity=(opacity)?opacity:(diff<0)?100:0; opacity+=diff;
if(document.getElementById&&document.all){
document.getElementById(id).style.filter="alpha(opacity="+opacity+")";
}else if(document.getElementById&&!document.all){
document.getElementById(id).style.MozOpacity = opacity/100;
}
document.getElementById(id).style.visibility="visible";
if(opacity>=99){
zindex++;
document.getElementById(id).style.zIndex=zindex;
setTimeout("fade("+n+",-"+diff+","+opacity+");",2000);
nn=(n==divs.length-1)?0:n+1;
setTimeout("fade("+nn+","+diff+");",2000);
} else if(opacity>0){
setTimeout("fade("+n+","+diff+","+opacity+");",30);
}
}
fade(0,1);
</script>
Tillbaks