aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/htmldetailselement
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/htmldetailselement
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/htmldetailselement')
-rw-r--r--files/ja/web/api/htmldetailselement/index.html48
-rw-r--r--files/ja/web/api/htmldetailselement/toggle_event/index.html126
2 files changed, 174 insertions, 0 deletions
diff --git a/files/ja/web/api/htmldetailselement/index.html b/files/ja/web/api/htmldetailselement/index.html
new file mode 100644
index 0000000000..33fb7304d3
--- /dev/null
+++ b/files/ja/web/api/htmldetailselement/index.html
@@ -0,0 +1,48 @@
+---
+title: HTMLDetailsElement
+slug: Web/API/HTMLDetailsElement
+translation_of: Web/API/HTMLDetailsElement
+---
+<div class="blockIndicator note">
+<p>translation in progress</p>
+</div>
+
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p>The <strong><code>HTMLDetailsElement</code></strong> interface provides special properties (beyond the regular {{domxref("HTMLElement")}} interface it also has available to it by inheritance) for manipulating {{HTMLElement("details")}} elements.</p>
+
+<p>{{InheritanceDiagram(600, 120)}}</p>
+
+<h2 id="Properties">Properties</h2>
+
+<p><em>Inherits properties from its parent, {{domxref("HTMLElement")}}.</em></p>
+
+<dl>
+ <dt>{{domxref("HTMLDetailsElement.open")}}</dt>
+ <dd>Is a {{domxref("boolean")}} reflecting the {{htmlattrxref("open", "details")}} HTML attribute, indicating whether or not the element’s contents (not counting the {{HTMLElement("summary")}}) is to be shown to the user.</dd>
+</dl>
+
+<h2 id="Methods">Methods</h2>
+
+<p><em>No specific method; inherits methods from its parent, {{domxref("HTMLElement")}}.</em></p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<ul>
+ <li><a href="https://html.spec.whatwg.org/multipage/interactive-elements.html#htmldetailselement">HTML Living Standard</a></li>
+ <li><a href="https://www.w3.org/TR/html52/interactive-elements.html#htmldetailselement">HTML 5.2 (W3C Proposed Recommendation)</a></li>
+</ul>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>
+
+
+<p>{{Compat("api.HTMLDetailsElement")}}</p>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>The HTML element implementing this interface: {{HTMLElement("details")}}</li>
+</ul>
diff --git a/files/ja/web/api/htmldetailselement/toggle_event/index.html b/files/ja/web/api/htmldetailselement/toggle_event/index.html
new file mode 100644
index 0000000000..880b31b439
--- /dev/null
+++ b/files/ja/web/api/htmldetailselement/toggle_event/index.html
@@ -0,0 +1,126 @@
+---
+title: 'HTMLDetailsElement: toggle イベント'
+slug: Web/API/HTMLDetailsElement/toggle_event
+tags:
+ - Event
+ - HTMLDetailsElement
+ - Reference
+ - details
+ - events
+ - toggle
+ - イベント
+translation_of: Web/API/HTMLDetailsElement/toggle_event
+---
+<div>{{APIRef}}</div>
+
+<p><strong><code>toggle</code></strong> イベントは、 {{HtmlElement("details")}} 要素の <code>open</code>/<code>closed</code> の状態がトグル切り替えされたときに発生します。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">バブリング</th>
+ <td>なし</td>
+ </tr>
+ <tr>
+ <th scope="row">キャンセル</th>
+ <td>不可</td>
+ </tr>
+ <tr>
+ <th scope="row">インターフェイス</th>
+ <td>{{DOMxRef("Event")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">イベントハンドラープロパティ</th>
+ <td>なし</td>
+ </tr>
+ <tr>
+ <th>既定のアクション</th>
+ <td>{{HtmlElement("details")}} 要素の <code>open</code> の状態をトグル切り替えする。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<p>この例は開かれた節をログ出力します。節が閉じられるとログから削除されます。</p>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;aside id="log"&gt;
+ &lt;b&gt;Open chapters:&lt;/b&gt;
+ &lt;div data-id="ch1" hidden&gt;I&lt;/div&gt;
+ &lt;div data-id="ch2" hidden&gt;II&lt;/div&gt;
+ &lt;div data-id="ch3" hidden&gt;III&lt;/div&gt;
+&lt;/aside&gt;
+&lt;section id="summaries"&gt;
+ &lt;b&gt;Chapter summaries:&lt;/b&gt;
+ &lt;details id="ch1"&gt;
+ &lt;summary&gt;Chapter I&lt;/summary&gt;
+ Philosophy reproves Boethius for the foolishness of his complaints against Fortune. Her very nature is caprice.
+ &lt;/details&gt;
+ &lt;details id="ch2"&gt;
+ &lt;summary&gt;Chapter II&lt;/summary&gt;
+ Philosophy in Fortune's name replies to Boethius' reproaches, and proves that the gifts of Fortune are hers to give and to take away.
+ &lt;/details&gt;
+ &lt;details id="ch3"&gt;
+ &lt;summary&gt;Chapter III&lt;/summary&gt;
+ Boethius falls back upon his present sense of misery. Philosophy reminds him of the brilliancy of his former fortunes.
+ &lt;/details&gt;
+&lt;/section&gt;</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">body {
+ display: flex;
+ flex-direction: row-reverse;
+}
+
+#log {
+ flex-shrink: 0;
+ padding-left: 3em;
+}
+
+#summaries {
+ flex-grow: 1;
+}</pre>
+
+<h3 id="JavaScript">JavaScript</h3>
+
+<pre class="brush: js">function logItem(e) {
+ const item = document.querySelector(`[data-id=${e.target.id}]`);
+ item.toggleAttribute('hidden');
+}
+
+const chapters = document.querySelectorAll('details');
+chapters.forEach((chapter) =&gt; {
+ chapter.addEventListener('toggle', logItem);
+});</pre>
+
+<h3 id="Result" name="Result">結果</h3>
+
+<p>{{EmbedLiveSample("Examples", 700, 200)}}</p>
+
+<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('HTML WHATWG', 'indices.html#event-toggle', 'toggle event')}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</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("api.HTMLDetailsElement.toggle_event")}}</p>