実行結果
- Fade in
- Fly in
- Fly out
- Flip in
- Flip out
- Scroll in
- Scroll out
- Single Door
- Double Door
設置サンプルのソース
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>jQuery.ImageSwitch | 設置サンプル</title>
<link rel="stylesheet" type="text/css" href="/content/lib/global.css" media="all" />
<!-- JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/content/lib/jquery/Groject.ImageSwitch.js"></script>
<script type="text/javascript">
var ImgIdx = 0;
var pics=[
"http://farm4.static.flickr.com/3214/3142429603_3b4ddd96a9.jpg",
"http://farm4.static.flickr.com/3244/3142386073_87c62671a5.jpg",
"http://farm4.static.flickr.com/3113/3142386067_fc176636eb.jpg",
"http://farm4.static.flickr.com/3089/3143248598_018daa38eb.jpg"
];
/* 画像の先読み */
function PreloadImg(){
var img = new Image();
img.src=pics[0];
img.src=pics[1];
img.src=pics[2];
img.src=pics[3];
}
$(function(){
PreloadImg();
$(".SlashEff ul li").click(function(){
$(".Slash").ImageSwitch({
Type:$(this).attr("rel"),
NewImage:pics[ImgIdx],
Direction:"DownTop",
EffectOriginal:false
});
ImgIdx++;
if(ImgIdx>3) ImgIdx = 0;
});
});
</script>
<!-- CSS -->
<style type="text/css">
.SplashFrame { width:500px; height:375px; margin:0; padding:0; border:1px solid #000; }
.SlashEff { width:500px; height:62px; margin:20px 0; padding:0; }
.SlashEff ul { list-style:none; margin:0; padding:0; overflow:hiddne; }
.SlashEff ul li { margin:0; padding:0; float:left; list-style-:none; width:25%; cursor:pointer; text-align:center; color:blue; text-decoration:underline; }
.SlashEff ul li:hover { text-decoration:none; }
</style>
<link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
<body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<h1><a href='http://www.hieu.co.uk/ImageSwitch/'>jQuery.ImageSwitch</a> | 設置サンプル</h1>
<!-- CODE -->
<div class="SplashFrame">
<img src="http://farm4.static.flickr.com/3089/3143248598_018daa38eb.jpg" alt="イルミネーション@サザンテラス" class="Slash"/>
</div>
<div class="SlashEff cf">
<ul>
<li class="TryFadeIn" rel="FadeIn">Fade in</li>
<li class="TryFlyIn" rel="FlyIn">Fly in</li>
<li class="TryFlyOut" rel="FlyOut">Fly out</li>
<li class="TryFlipIn" rel="FlipIn">Flip in</li>
<li class="TryFlipOut" rel="FlipOut">Flip out</li>
<li class="TryScroll" rel="ScrollIn">Scroll in</li>
<li class="TryScroll" rel="ScrollOut">Scroll out</li>
<li class="TrySingleDoor" rel="SingleDoor">Single Door</li>
<li class="TryDoubleDoor" rel="DoubleDoor">Double Door</li>
</ul>
</div>
<!-- / CODE -->
</body>
</html>