If you want fading effects for various elements on an html page then the jQuery javascript library is for you. The following example fades out and then fades back in all divs on a page that are clicked.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
$("div").click(function() {
$("div").fadeOut("slow", function() {
$("div").fadeIn("slow");
});
});
});
</script>
</head>
<body>
<div style="width: 400px; height: 400px; background: #CC0000; border: #000000"></div>
</body>
</html>
Here's the javascript bit on it's own:
$(function(){
$("div").click(function() {
$("div").fadeOut("slow", function() {
$("div").fadeIn("slow");
});
});
});