<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Beispiel</title>
<style type="text/css">
<!--
.div1,div2{
background-color:#ffffff;
position:absolute;
top:10px;
width:220px;
height:30px;
}
.div1{
filter: alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
z-index:1;
}
-->
</style>
<script type="text/javascript">
<!--
var val=100;
var opac='';
var obj;
function init(){
obj=document.getElementById('div1');
if(typeof(obj.style.MozOpacity)=='string')opac='moz';
else if(typeof(obj.style.opacity)=='string')opac='css3';
else if(typeof(obj.style.filter)=='string')opac='ie';
if(opac!='')setTimeout('fade()',1000);
}
function fade(){
val2=Math.round(val);
if(opac=='css3')obj.style.opacity=val2/100;
if(opac=='ie')obj.style.filter='alpha(opacity='+val2+')';
if(opac=='moz')obj.style.MozOpacity=val2/100;
obj.style.opacity=val2/100;
val-=.5;
if (val>0)setTimeout('fade()',10);
}
//-->
</script>
</head>
<body onload="init()">
<div id="div1" class="div1"></div>
<div id="div2" class="div2">Ich werde langsam sichtbar</div>
</body>
</html>