[Simple jQuery Slideshowライブラリ] スライドを表示する

説明

Simple jQuery Slideshowライブラリでスライドを表示するには、あらかじめ表示する画像をdivタグで囲んでおきます。ページ内容が読み込まれたら画像を囲んでいるdivタグに対してslideshow()メソッドを実行します。これで自動的にスライドショーとなります(自動再生されます)。

サンプルプログラム

【HTML】
<!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/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.slideshow.js"></script>
<script type="text/javascript" src="js/sample.js"></script>
</head>
<body>
<h1>Simple jQuery Slideshowサンプル</h1>
<div id="slideshow">
<img src="photo/1.jpg" alt="松本城">
<img src="photo/2.jpg" alt="浅間山">
<img src="photo/3.jpg" alt="高ボッチ">
<img src="photo/4.jpg" alt="三九郎(どんど焼き)">
<img src="photo/5.jpg" alt="雪景色">
<img src="photo/6.jpg" alt="浅間温泉街">
</div>
</body>
</html>


【sample.js】
$(function(){
$("#slideshow").slideshow();
});
サンプルを実行
[戻る]