• 検索結果がありません。

ギャラリーの向きの設定

ドキュメント内 MVC Tools (ページ 183-187)

duration: 1000, easing:null }

$('#showEffectTypes').change(function () {

var ee = $("#showEffectTypes option:selected").val();

$.extend(transitions, { animated:ee });

$("#wijgallery").wijgallery("option", "transitions", transitions);

});

});

</script>

これによりギャラリーが初期化され、アニメーションが追加されます。

このトピックの作業結果

[F5]を押してアプリケーションを実行し、ドロップダウンボックスからアニメーションスタイルを選択します。

スタイルを適用すると、〈前へ〉または〈次へ〉ボタンを使用して画像をナビゲートし、選択したアニメーションを 表示できます。

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/3">

<img alt="3" src="http://lorempixum.com/200/150/sports/3" title="キャプション 3" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/4">

<img alt="4" src="http://lorempixum.com/200/150/sports/4" title="キャプション 4" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/5">

<img alt="5" src="http://lorempixum.com/200/150/sports/5" title="キャプション 5" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/6">

<img alt="6" src="http://lorempixum.com/200/150/sports/6" title="キャプション 6" />

</a></li>

</ul>

</div>

<br />

<h3>向きは "vertical"、右側</h3>

<br />

<div id="wijgallery1" class="">

<ul class="">

<li class=""><a href="http://lorempixum.com/750/300/city/1">

<img alt="1" src="http://lorempixum.com/200/150/city/1" title="キャプション 1" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/city/2">

<img alt="2" src="http://lorempixum.com/200/150/city/2" title="キャプション 2" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/city/3">

<img alt="3" src="http://lorempixum.com/200/150/city/3" title="キャプション 3" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/city/4">

<img alt="4" src="http://lorempixum.com/200/150/city/4" title="キャプション 4" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/city/5">

<img alt="5" src="http://lorempixum.com/200/150/city/5" title="キャプション 5" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/city/6">

<img alt="6" src="http://lorempixum.com/200/150/city/6" title="キャプション 6" />

</a></li>

</ul>

</div>

<br />

<h3>向きは"horizontal"、上部</h3>

<br />

<div id="wijgallery3" class="">

<ul class="">

<li class=""><a href="http://lorempixum.com/750/300/sports/1">

<img alt="1" src="http://lorempixum.com/200/150/sports/1" title="キャプション 1" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/2">

<img alt="2" src="http://lorempixum.com/200/150/sports/2" title="キャプション 2" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/3">

<img alt="3" src="http://lorempixum.com/200/150/sports/3" title="キャプション 3" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/4">

<img alt="4" src="http://lorempixum.com/200/150/sports/4" title="キャプション 4" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/5">

<img alt="5" src="http://lorempixum.com/200/150/sports/5" title="キャプション 5" />

</a></li>

<li class=""><a href="http://lorempixum.com/750/300/sports/6">

<img alt="6" src="http://lorempixum.com/200/150/sports/6" title="キャプション 6" />

</a></li>

</ul>

</div>

このマークアップは、3つのギャラリーウィジェットのコンテンツをページに追加します。次の手順では、ギャラ リーの向きを設定します。

4. 前の手順で追加した </div> 終了タグの後に、以下の jQuery スクリプトを入力し、wijgallery ウィジェットを初 期化して orientation オプションを設定します。

<script id="scriptInit" type="text/javascript">

$(document).ready(function () { $("#wijgallery").wijgallery({

thumbnailOrientation:"vertical", thumbnailDirection:"before", thumbsDisplay: 3,

thumbsLength: 150, showCounter:false, showTimer:false,

});

$("#wijgallery1").wijgallery({

thumbnailOrientation:"vertical", thumbsDisplay: 3,

showCounter:false, thumbsLength: 150, showTimer:false });

$("#wijgallery3").wijgallery({

thumbnailDirection:"before", showCounter:false,

showTimer:false });

});

</script>

<style type="text/css">

.wijmo-wijcarousel-text span {

padding:5px;

}

#wijgallery, #wijgallery1 {

width:750px;

height:240px;

}

#wijgallery3 {

width:750px;

height:411px;

}

</style>

2つのギャラリーが縦向きに表示され、1つのギャラリーが横向きに表示されます(デフォルト)。

このトピックの作業結果

[F5]を押してアプリケーションを実行し、2つのギャラリーが縦向きに(1つがサムネイル画像付きで左側に、

1つがサムネイル画像付きで右側に)表示され、1つのギャラリーが横向きに表示されることを確認します。

ドキュメント内 MVC Tools (ページ 183-187)