diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/css/scroll-snap-stop | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/css/scroll-snap-stop')
-rw-r--r-- | files/ja/web/css/scroll-snap-stop/index.html | 226 |
1 files changed, 226 insertions, 0 deletions
diff --git a/files/ja/web/css/scroll-snap-stop/index.html b/files/ja/web/css/scroll-snap-stop/index.html new file mode 100644 index 0000000000..25ba842a38 --- /dev/null +++ b/files/ja/web/css/scroll-snap-stop/index.html @@ -0,0 +1,226 @@ +--- +title: scroll-snap-stop +slug: Web/CSS/scroll-snap-stop +tags: + - CSS + - CSS スクロールスナップ + - Reference + - scroll-snap-stop + - ウェブ +translation_of: Web/CSS/scroll-snap-stop +--- +<div>{{CSSRef}}{{SeeCompatTable}}</div> + +<p><a href="/ja/docs/Web/CSS">CSS</a> の <strong><code>scroll-snap-stop</code></strong> プロパティは、スクロールコンテナーが可能なスナップ位置を「通り過ぎる」ことを許可するかどうかを定義します。</p> + +<pre class="brush:css no-line-numbers">/* キーワード値 */ +scroll-snap-stop: normal; +scroll-snap-stop: always; + +/* グローバル値 */ +scroll-snap-type: inherit; +scroll-snap-type: initial; +scroll-snap-type: unset; +</pre> + +<p>{{cssinfo}}</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<h3 id="Values" name="Values">値</h3> + +<dl> + <dt><code>normal</code></dt> + <dd>スクロールコンテナーの視覚的な{{Glossary("viewport", "ビューポート")}}がスクロールされた時、可能なスナップ位置を「通り過ぎる」ことがあります。</dd> + <dt><code>always</code></dt> + <dd>スクロールコンテナーは可能なスナップ位置を「通り過ぎる」ことはありません。最初の要素のスナップ位置にスナップします。</dd> +</dl> + +<h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="Example" name="Example">例</h2> + +<p>この例は {{cssxref("scroll-snap-type")}} から複製したものに多少の修正を加えたものです。</p> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">/* setup */ +:root, body { + height: 100%; + display: flex; + align-items: center; + justify-content: space-between; + flex-flow: column nowrap; + font-family: monospace; +} +.container { + display: flex; + overflow: auto; + outline: 1px dashed lightgray; + flex: none; +} + +.container.x { + width: 100%; + height: 128px; + flex-flow: row nowrap; +} + +.container.y { + width: 256px; + height: 256px; + flex-flow: column nowrap; +} +/* definite scroll snap */ +.mandatory-scroll-snapping { + scroll-snap-stop: always; +} +.proximity-scroll-snapping { + scroll-snap-stop: normal; +} +/* scroll-snap */ +.x.mandatory-scroll-snapping { + scroll-snap-type: x mandatory; +} + +.y.mandatory-scroll-snapping { + scroll-snap-type: y mandatory; +} + +.x.proximity-scroll-snapping { + scroll-snap-type: x proximity; +} + +.y.proximity-scroll-snapping { + scroll-snap-type: y proximity; +} + +.container > div { + text-align: center; + scroll-snap-align: center; + flex: none; +} + +.x.container > div { + line-height: 128px; + font-size: 64px; + width: 100%; + height: 128px; +} + +.y.container > div { + line-height: 256px; + font-size: 128px; + width: 256px; + height: 256px; +} +/* appearance fixes */ +.y.container > div:first-child { + line-height: 1.3; + font-size: 64px; +} +/* coloration */ +.container > div:nth-child(even) { + background-color: #87EA87; +} + +.container > div:nth-child(odd) { + background-color: #87CCEA; +} +</pre> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><div class="container x mandatory-scroll-snapping" dir="ltr"> + <div>X Mand. LTR </div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container x proximity-scroll-snapping" dir="ltr"> + <div>X Proximity LTR</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container y mandatory-scroll-snapping" dir="ltr"> + <div>Y Mand. LTR</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container y proximity-scroll-snapping" dir="ltr"> + <div>Y Prox. LTR</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container x mandatory-scroll-snapping" dir="rtl"> + <div>X Mandatory RTL</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container x proximity-scroll-snapping" dir="rtl"> + <div>X Proximity RTL</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container y mandatory-scroll-snapping" dir="rtl"> + <div>Y Mand. RTL</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> + +<div class="container y proximity-scroll-snapping" dir="rtl"> + <div>Y Prox. RTL</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> +</div> +</pre> + +<p>{{EmbedLiveSample("Example", "100%", "1630")}}</p> + +<h2 id="Specification" name="Specification">仕様書</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様書</th> + <th scope="col">状態</th> + <th scope="col">備考</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("CSS Scroll Snap Points", "#propdef-scroll-snap-stop", "scroll-snap-stop")}}</td> + <td>{{Spec2("CSS Scroll Snap Points")}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> + +<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> + +<p>{{Compat("css.properties.scroll-snap-stop")}}</p> |