<!-- jQueryとFilterizrを追加 -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/filterizr/1.3.4/jquery.filterizr.min.js"></script>
<script>
$(function () {
$('.filter').filterizr({
option
});
});
</script>
<ul class="nav">
<li data-filter="all"> All </li>
<li data-filter="1"> 1 </li>
<li data-filter="2"> 2 </li>
...
</ul>
<ul class="nav">
<div class="filter">
<div class="filtr-item" data-category="1" data-sort="100">...</div>
...
</div>
Property | Type | Default | Description |
---|---|---|---|
animationDuration | Number | 0.5 | The duration of CSS3 transitions, taking place for your effects. |
callbacks | Used as the namespace for your callbacks. | ||
onFilteringStart | function | function() { } | This event is thrown in the filter method to indicate that filtering has started. |
onFilteringEnd | function | function() { } | This event is thrown in the filter method to indicate that filtering has ended. |
onShufflingStart | function | function() { } | This event is thrown in the shuffle method to indicate that shuffling has begun. |
onShufflingEnd | function | function() { } | This event is thrown to indicate that shuffling has ended. |
onSortingStart | function | function() { } | This event is thrown in the sort method to indicate that sorting has begun. |
onSortingEnd | function | function() { } | This event is thrown to indicate that sorting has ended. |
controlsSelector | String | '' | In case there is the need to have more than one Filterizr instance on the same page then you need to set up different controls for them. This is where this option comes in handy. |
delay | Number | 0 | Measured in milliseconds and used to set the value of the transition-delay property of every item. The value of the transition-delay is incremented progressively by the value of delay for every item to create a more progressive version of your effect. |
delayMode | String | 'progressive' | Determines how delay is applied to the transition between items. The two possible values are progressive and alternate. The value of delayMode makes no difference if delay is 0. |
easing | String | 'ease-out' | The easing algorithm used for CSS3 transitions. Look up the CSS3 transition-timing-function property for possible values. |
filter | String | 'all' | The default value can be used for an unfiltered gallery. To initialize a filtered gallery, set this property to your category of choice before instantiating Filterizr. |
filterOutCss | An object with CSS properties, written the same way you would write it for jQuery's .css() function. This the transition that plays when your items are being filtered out. | ||
opacity | Number | 0 | |
transform | String | 'scale(0.5)' | |
filterInCss | An object with CSS properties, written the same way you would write it for jQuery's .css() function. This the transition that plays when your items are being filtered in. | ||
opacity | Number | 0 | |
transform | String | 'scale(1)' | |
layout | String | 'sameSize' | By default sets the layout for items with same width and height. Other possible values are: 'packed' for a layout of items of varying width and height, 'sameWidth' for a layout of items with the same width but varying height. 'sameHeight' for a layout of items with the same height but varying width. 'horizontal' for a layout of items laid out horizontally. 'vertical' for a layout of items laid out vertically. To see a demo of each and every layout, check the Tutorials section. |
multifilterLogicalOperator | String | 'or' | This option defines the logic in which multifiltering will be applied in case it's enabled. If set to 'or' then it will render all items that belong to one of the active categories e.g. 3 or 4. If set to 'and' then it will render all items that belong to both categories i.e. 3 and 4. |
selector | String | '.filtr-container' | The selector of the container used for your gallery. |
setupControls | Boolean | true | If set to true then Filterizr will try to detect and set up filtering, shuffling and sorting controls. In case you have multiple Filterizrs in your view, you might decide to set this to false and set up your own controls, using the public API, so as to avoid interference the controls of your Filterizrs. |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- jQueryとFilterizrを追加 -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/filterizr/1.3.4/jquery.filterizr.min.js"></script>
<title>Filterizr #1. 基本的なフィルタリング</title>
<style>
.wrapper {
max-width: 500px;
}
.nav {
display: flex;
margin: 15px 0;
padding: 0;
}
.nav li {
font-size: 14px;
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 80px;
margin: 3px;
padding: 5px 0;
list-style: none;
cursor: pointer;
transition: all .5s;
color: #fff;
border-radius: 5px;
background-color: hsl(174, 100%, 29%);
}
.nav li:hover {
background-color: hsl(174, 100%, 35%);
}
.nav strong {
width: 150px;
font-size: 12px;
}
[class^='box-'],
[class*='box-'] {
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100px;
height: 100px;
color: #fff;
box-shadow: 0 0 0 2px #f1f1f1 inset;
}
.box-green {
background: green;
}
.box-orange {
background: orange;
}
.box-purple {
background: purple;
}
</style>
</head>
<body>
<header>
<h1 class="dlw-title">Filterizr
<small>#1. 基本的なフィルタリング</small>
</h1>
<p class="dlw-description">Filterizrはコンテナ内のアイテムをフィルタリング、並べ替え、シャッフル、検索をするjQueryプラグインです。
<br>これはオプションを使用しない基本的なサンプルです。</p>
</header>
<section>
<h2 class="dlw-subtitle">[1] Basic Filtering</h2>
<p>データ属性値に従ってフィルタリングをかけます。</p>
<script>
$(function () {
$('.filter').filterizr();
});
</script>
<ul class="nav">
<strong>シングルフィルタリング:</strong>
<!-- "data-filter"の値でアイテムの"data-category"を参照してフィルタリングをかけます。 -->
<li data-filter="all"> All </li>
<li data-filter="1"> Green </li>
<li data-filter="2"> Orange </li>
<li data-filter="3"> Purple </li>
</ul>
<ul class="nav">
<!-- "data-filter"の値でアイテムの"data-category"を参照して複数のフィルタリングをかけます。 -->
<strong>マルチフィルタリング:</strong>
<li data-multifilter="1"> Green </li>
<li data-multifilter="2"> Orange </li>
<li data-multifilter="3"> Purple </li>
</ul>
<ul class="nav">
<!-- アイテムの"data-sort"の値でソートを並べ替えます。 -->
<strong>並べ替え:</strong>
<li data-sortasc>Asc</li>
<li data-sortdesc>Desc</li>
</ul>
<div class="nav">
<strong>検索:</strong>
<!-- "data-search"を追加したインプットフォームでアイテムを検索します。 -->
<input type="text" name="search" placeholder="検索..." data-search>
</div>
<div class="wrapper">
<div class="filter">
<div class="filtr-item box-orange" data-category="2" data-sort="8363710">
New York
</div>
<div class="filtr-item box-green" data-category="1" data-sort="3833995">
Los Angeles
</div>
<div class="filtr-item box-purple" data-category="3" data-sort="2853114">
Chicago
</div>
<div class="filtr-item box-green" data-category="1" data-sort="2242193">
Houston
</div>
<div class="filtr-item box-purple" data-category="3" data-sort="1567924">
Phoenix
</div>
<div class="filtr-item box-purple" data-category="3" data-sort="1447395">
Philadelphia
</div>
<div class="filtr-item box-orange" data-category="2" data-sort="1351305">
San Antonio
</div>
<div class="filtr-item box-green" data-category="1" data-sort="1279910">
Dallas
</div>
<div class="filtr-item box-orange" data-category="2" data-sort="1279329">
San Diego
</div>
<div class="filtr-item box-green" data-category="1" data-sort="948279">
San Jose
</div>
</div>
</div>
</section>
</body>
</html>
ここではテキストにスタイルシートで様々な効果を付したデザインサンプルを掲載しています。
見出しは、その下の記事の性質を示すテキストです。
ここでは、スタイルシートを使用した見出しのデザインサンプルが掲載しています。
HTML <ol> 要素は順序付けられた項目リストを表します。
ここでは、スタイルシートを使用するolのデザインサンプルを掲載しています。
HTML <hr>要素は、段落レベルの要素間のテーマ区切りを表します。
ここでは、スタイルシートを使用してhrのデザインサンプルを掲載しています。
CSSプロパティbox-shadowは、要素のフレーム枠の周囲にシャドーエフェクトを追加するために使用されます。
ここでは、スタイルシートを使用したボックスシャドウプロパティのデザインサンプルを掲載しています。
このサンプルではIE用にPicturefillを追加しています。
Bootstrapフレームワークの標準的なボタンデザインです。
Hover.cssはマウスオーバー効果のスタイルシートコレクションです。
Button.cssは、CSS3のボタンアニメーションのコレクションです。
これはBootstrapフレームワークの標準的なカードデザインのまとめです。
Arctext.jsは文字列を指定した円半径に沿ってカーブさせるjQueryプラグインです。
Lettering.jsは、1文字、1単語、1列の指定された文字列を<span>タグで囲むjQueryプラグインです。
Textillate.jsは、イン/アウトアニメーションエフェクトをテキストに追加するjQueryプラグインです。
FitText.jsは、親要素の幅に応じてフォントサイズをフィットさせるjQueryプラグインです。
FeedEkは、RSSフィードとAtomフィードを解析して表示するjQueryプラグインです。
YouTubeのさまざまな埋め込み方法の紹介。
FitVidsはiframeで埋め込まれたYouTube動画をレスポンシブ対応に変換するjQueryプラグインです。
xZoomは画像のズームプレビューを表示するjQueryプラグインです。
プレビュー位置とズームをカスタマイズすることができます。
Instagram.cssは、インスタントグラムのような写真をフィルタリングするスタイルシートです。
Moment.jsは日付と時刻を処理して表示するjavascriptです。
このサンプルでは日本語にローカライズしています。
Bootstrap Material DatePickerはMoment.jsを使用したjQueryデータピッカープラグインです。
MultifilterはjQueryテーブルフィルタリングプラグインです。
"display: flex;"を使用したレスポンステーブル
rowspanはサポートされていません。
"display: grid;"を使用したレスポンステーブル
rowspanはサポートされていません。
Bootstrapフレームワークの標準的なテーブルデザインです。
jQuery Mask Pluginは、フォームフィールドでマスク(検証)を行うjQueryプラグインです。
Select2は、セレクトフォームをより高度にするjqueryプラグインです。
Select2の基本的な使い方は次のとおりです。
jQuery Searcherは、さまざまなマークアップをサポートするjQuery検索/フィルタリングプラグインです。
Bootstrapフレームワークの標準的なカルーセルです。
FlexSliderはレスポンシブjQueryスライダープラグインです。
ここにはFlexsliderの基本的な単一スライダー設定を掲載しています。
FlexSliderはレスポンシブjQueryスライダープラグインです。
ここにはFlexsliderの基本的なカルーセルスライダー設定を掲載しています。
fancyBoxはjQueryライトボックスプラグインです。
ここではfancyBoxの基本的なイメージライトボックスの設定を行います。
fancyBoxはjQueryライトボックスプラグインです。
ここでは、YouTube、Vimeo、Instagram、Googleマップ、fancyBoxのインラインHTML、iframeライトボックスの設定を掲載しています。
animsitionはページ遷移時にアニメーションエフェクトを追加するjQueryプラグインです。
GreedyNavは画面縮小時にはみ出した項目をドロップダウンに切り替えるjQueryを用いたレスポンシブナビゲーションメニューです。
GridTabはグリッドベースのレスポンシブタブを作成する軽量なjQueryプラグインです。
jQuery.NiceScrollはスクロールの表示と機能を拡張するjQueryプラグインです。
metisMenuは水平・垂直メニューを展開するjQueryプラグインです。
fullPage.jsはフルスクリーンスクロールjQueryプラグインです。
ここでは、基本的なfullPage.jsのフルスクリーンスクロールを掲載しています。
fullPage.jsはフルスクリーンスクロールjQueryプラグインです。
ここではナビゲーションメニューを表示しています。
Offside.jsはオフキャンバス展開するJavaScriptキットです。
これは、左側オフキャンバスが展開するサンプルです。
Offside.jsはオフキャンバス展開するJavaScriptキットです。
これは、複数のオフキャンバスが展開するサンプルです。
Filterizrはコンテナ内のアイテムをフィルタリング、並べ替え、シャッフル、検索をするjQueryプラグインです。
これはオプションを使用しない基本的なサンプルです。
Filterizrはコンテナ内のアイテムをフィルタリング、並べ替え、シャッフル、検索をするjQueryプラグインです。
これはFilterizrのより高度なフィルタリングのサンプルです。
animsitionはページ遷移時にアニメーションエフェクトを追加するjQueryプラグインです。
Textillate.jsは、イン/アウトアニメーションエフェクトをテキストに追加するjQueryプラグインです。
Scrollaはスクロール時に表示するアイテムにアニメーション効果を付加するjQueryプラグインです。
Hover.cssはマウスオーバー効果のスタイルシートコレクションです。
Animate.cssはアニメーション効果のスタイルシートコレクションです。
jQuery Easing Plugin はjQueryのイージング(アニメーション効果)を拡張するプラグインです。
ここでは要素へのイージングのサンプルを掲載しています。
fullPage.jsはフルスクリーンスクロールjQueryプラグインです。
ここでは、基本的なfullPage.jsのフルスクリーンスクロールを掲載しています。
fullPage.jsはフルスクリーンスクロールjQueryプラグインです。
ここではナビゲーションメニューを表示しています。
jQuery.mb.YTPlayerは背景にYouTube動画を表示するjQueryプラグインです。
Hint.cssはツールチップ用のスタイルシートです。
クラス名を追加するだけでツールチップを表示することが出来ます。
Protipはツールチップを生成するjQueryプラグインです。
ツールヒントの位置、大きさなどは、データ属性のみで設定します。
Bootstrapフレームワークの標準的なカルーセルです。
これはBootstrapフレームワークの標準的なカードデザインのまとめです。
Bootstrapフレームワークの標準的なボタンデザインです。
Bootstrapフレームワークの標準的なテーブルデザインです。
GreenSockによるTweenMAX、TweenLite、TimelineLite、TimelineMaxのチートシート
このページでは、コードをまとめて検索することができます。