フェードイン/フェードアウトさせる
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/prototype.js" charset="shift_jis"></script>
<script type="text/javascript" src="js/scriptaculous.js" charset="shift_jis"></script>
<script type="text/javascript"><!--
Event.observe(window, "load", function(){
$$("#photoArea img").each(function(ele){
new Effect.Fade(ele, { from:1.0, to:0.3 });
Event.observe(ele, "mouseover", function(){
new Effect.Appear(ele, { to:1.0 });
});
Event.observe(ele, "mouseout", function(){
new Effect.Opacity(ele, { to:0.3 });
});
});
}, false);
// --></script>
</head>
<body>
<h1>フェードエフェクト</h1>
<div id="photoArea">
<img src="images/photo001.jpg" alt="山">
<img src="images/photo002.jpg" alt="花">
</div>
</body>
</html>
説明などは本書を参考にしてください。