Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Fader Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#pak {
width:201px;
height:375px;
background:black url(pak1.jpg);
}
#pak img {
opacity:0;
display:block;
}
</style>
<!--[if gte IE 6]>
<style type="text/css">
#pak img {
filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);
}
</style>
<![endif]-->
<script type="text/javascript">
function fade(el, way){
/*Modern Browser Fader by John Davenport Scheuer
This comment must remain for Legal Use */
clearTimeout(el.timer);
var targ_op=way=='in'&&el.filters&&el.filters[0]? 100 : way=='in'? 1 : 0;
var waym=way=='in'? 1 : -1;
var optype=el.filters&&el.filters[0]&&typeof el.filters[0].opacity=='number'? el.filters[0] : el.style;
var opinc=el.filters&&el.filters[0]? 10 : .1;
if(/number|string/.test(typeof optype.opacity))
optype.opacity=optype.opacity*1 + opinc*waym;
else
return;
if(optype.opacity!=targ_op)
el.timer=setTimeout(function(){fade(el, way)}, 30);
}
</script>
</head>
<body>
<div id="pak"><img src="pak2.jpg" alt="" onmouseover="fade(this, 'in');" onmouseout="fade(this, 'out');"></div>
</body>
</html>
Bookmarks