クロスフェードで切り替わるシンプルなスライドショー


☆ソース

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>JavaScriptでクロスフェード</title>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.cross-slide.min.js"></script>
<style type="text/css">
* {
  margin: 0;
  padding: 0;
}
img {
  border: none;
  vertical-align: bottom;
}
body {
  color:#FFF; 
  background:#fff;
  text-align: center;
}
#slideshow {
  margin: 30px auto;
  width: 600px;
  height: 450px;
}
</style>
</head>
<body>
<script>
  $(function() {
    $('#slideshow').crossSlide({
      sleep: 3,
      fade: 2
    }, [
      { src: 'images/1.jpg' },
      { src: 'images/2.jpg' },
      { src: 'images/3.jpg' },
      { src: 'images/4.jpg' },
      { src: 'images/5.jpg' }
    ])
  });
</script>
<div id="slideshow"></div>
</body>
</html>