aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/navigator/vibrate
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/navigator/vibrate')
-rw-r--r--files/ja/web/api/navigator/vibrate/index.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/files/ja/web/api/navigator/vibrate/index.html b/files/ja/web/api/navigator/vibrate/index.html
new file mode 100644
index 0000000000..fedd3c8f2e
--- /dev/null
+++ b/files/ja/web/api/navigator/vibrate/index.html
@@ -0,0 +1,65 @@
+---
+title: Navigator.vibrate()
+slug: Web/API/Navigator/vibrate
+tags:
+ - API
+ - Method
+ - Navigator
+ - Reference
+ - Vibration API
+translation_of: Web/API/Navigator/vibrate
+---
+<div>{{APIRef("Vibration API")}}</div>
+
+<p><strong><code>Navigator.vibrate()</code></strong> メソッドは、端末のバイブレーションハードウェアがあればパルスを送ります。端末がバイブレーションに対応していない場合は、このメソッドは効果はありません。このメソッドが呼び出されたときに、すでにバイブレーションパターンが進行中であった場合は、前のパターンが停止され、代わりに新しいパターンが始まります。</p>
+
+<p>引数が無効であるためこのメソッドがバイブレーションを実行できなかった場合は <code>false</code> を返し、それ以外の場合は <code>true</code> を返します。パターンによってとても長いバイブレーションが指定された場合は、短縮されます。最大長は実装に依存します。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox">var <em>successBool</em> = window.navigator.vibrate(<em><var>pattern</var></em>);
+</pre>
+
+<dl>
+ <dt><code><var>pattern</var></code></dt>
+ <dd>バイブレーションと停止の間隔のパターンを提供します。それぞれの値はミリ秒単位の数値でバイブレーションと停止の長さを交互に表します。単一の値 (そのミリ秒だけ一度バイブレーションを行う) か、値の配列でバイブレーション、停止、再度バイブレーションと交互の値の配列で指定することができます。詳しくは <a href="/ja/docs/WebAPI/Vibration">Vibration API</a> を参照してください。</dd>
+</dl>
+
+<p><code>0</code> の値、空の配列、すべての値がゼロである配列を渡すと、現在進行中のバイブレーションパターンをすべて中止します。</p>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<pre class="brush: js">window.navigator.vibrate(200); // vibrate for 200ms
+window.navigator.vibrate([100,30,100,30,100,30,200,30,200,30,200,30,100,30,100,30,100]); // モールス信号で 'SOS' とバイブレーションします。
+</pre>
+
+<h2 id="Specifications" name="Specifications">仕様書</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('Vibration API')}}</td>
+ <td>{{Spec2('Vibration API')}}</td>
+ <td>Linked to spec is the latest editor's draft; W3C version is a REC.</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("api.Navigator.vibrate")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li><a href="/ja/docs/WebAPI/Vibration">Vibration API</a></li>
+</ul>