aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/globaleventhandlers/onresize/index.html
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 12:07:59 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 12:07:59 +0100
commit6ef1fa4618e08426b874529619a66adbd3d1fcf0 (patch)
tree890e3e27131be010d82ef957fa68db495006cb0e /files/ja/web/api/globaleventhandlers/onresize/index.html
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-6ef1fa4618e08426b874529619a66adbd3d1fcf0.tar.gz
translated-content-6ef1fa4618e08426b874529619a66adbd3d1fcf0.tar.bz2
translated-content-6ef1fa4618e08426b874529619a66adbd3d1fcf0.zip
unslug ja: move
Diffstat (limited to 'files/ja/web/api/globaleventhandlers/onresize/index.html')
-rw-r--r--files/ja/web/api/globaleventhandlers/onresize/index.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/files/ja/web/api/globaleventhandlers/onresize/index.html b/files/ja/web/api/globaleventhandlers/onresize/index.html
new file mode 100644
index 0000000000..db2b2bbae9
--- /dev/null
+++ b/files/ja/web/api/globaleventhandlers/onresize/index.html
@@ -0,0 +1,78 @@
+---
+title: window.onresize
+slug: Web/API/Window/onresize
+tags:
+ - DOM
+ - Gecko
+ - Property
+ - Window
+translation_of: Web/API/GlobalEventHandlers/onresize
+---
+<p>{{ ApiRef() }}</p>
+
+<p><code><strong>GlobalEventHandlers.onresize</strong></code> プロパティは、{{event("resize")}} イベントを受信するとトリガーされる {{domxref("EventHandler")}} を含みます。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="eval">window.onresize = <em>funcRef</em>;
+</pre>
+
+<h3 id="Parameters" name="Parameters">引数</h3>
+
+<ul>
+ <li><code>funcRef</code>: 関数への参照</li>
+</ul>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre>window.onresize = doFunc;
+</pre>
+
+<pre>&lt;html&gt;
+&lt;head&gt;
+
+&lt;title&gt;onresize test&lt;/title&gt;
+
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;p&gt;Resize the browser window to fire the resize event.&lt;/p&gt;
+
+&lt;p&gt;Window height: &lt;span id="height"&gt;&lt;/span&gt;&lt;/p&gt;
+&lt;p&gt;Window width: &lt;span id="width"&gt;&lt;/span&gt;&lt;/p&gt;
+
+&lt;script type="text/javascript"&gt;
+ var heightOutput = document.querySelector('#height');
+ var widthOutput = document.querySelector('#width');
+
+ function resize() {
+ heightOutput.textContent = window.innerHeight;
+ widthOutput.textContent = window.innerWidth;
+ }
+
+ window.onresize = resize;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Notes" name="Notes">注記</h2>
+
+<p>ブラウザウィンドウのサイズが変更された後に <code>resize</code> イベントが発生します。</p>
+
+<h2 id="Specification" name="Specification">仕様</h2>
+
+<table class="spectable standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">使用</th>
+ <th scope="col">ステータス</th>
+ <th scope="col">コメント</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG','webappapis.html#handler-onresize','onresize')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>