That cannot be done just using HTML. With a some javascript, it can be done, though not all browsers will support the effect and none will without javascript enabled:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
if (document.all||document.getElementById){
document.write('<style id="tmpStyle" type="text/css">#pic {-moz-opacity:0.00;filter:alpha(opacity=0);opacity:0;-khtml-opacity:0;}<\/style>')
var objG, degree=fadeAssist=0;
if (document.all&&typeof document.documentElement!=='undefined')
document.write('<!--[if GTE IE 5]><script type="text/javascript">fadeAssist=function (obj, degree){try {obj.filters.alpha.opacity=degree}catch(e){obj.style.filter="alpha(opacity="+degree+")"}}<'+'\/'+'script><![endif]-->')
}
function fadepic(obj){
objG=obj
if (!document.getElementById&&!document.all)
return;
var tS=document.all? document.all['tmpStyle'] : document.getElementById('tmpStyle')
if (degree<100){
degree+=5
if (objG.filters&&objG.filters[0]&&fadeAssist)
fadeAssist(objG, degree)
else if (typeof objG.style.MozOpacity=='string')
objG.style.MozOpacity=degree/101
else if (typeof objG.style.KhtmlOpacity=='string')
objG.style.KhtmlOpacity=degree/100
else if (typeof objG.style.opacity=='string'&&!objG.filters)
objG.style.opacity=degree/101
else
tS.disabled=true
setTimeout("fadepic(objG)", 50)
}
else
tS.disabled=true
}
</script>
</head>
<body>
<img id="pic" onload="fadepic(this);" src="domfade.jpg">
</body>
</html>
Bookmarks