aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/html/element/dialog/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:15 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:15 -0500
commit4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch)
treed4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/ca/web/html/element/dialog/index.html
parent33058f2b292b3a581333bdfb21b8f671898c5060 (diff)
downloadtranslated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz
translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2
translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip
initial commit
Diffstat (limited to 'files/ca/web/html/element/dialog/index.html')
-rw-r--r--files/ca/web/html/element/dialog/index.html208
1 files changed, 208 insertions, 0 deletions
diff --git a/files/ca/web/html/element/dialog/index.html b/files/ca/web/html/element/dialog/index.html
new file mode 100644
index 0000000000..27a72bdde4
--- /dev/null
+++ b/files/ca/web/html/element/dialog/index.html
@@ -0,0 +1,208 @@
+---
+title: <dialog>
+slug: Web/HTML/Element/dialog
+tags:
+ - Dialog
+ - Element
+ - Experimental
+ - HTML
+ - HTML interactive elements
+ - Reference
+ - Web
+translation_of: Web/HTML/Element/dialog
+---
+<div>{{SeeCompatTable}}</div>
+
+<p>L'<strong>element HTML &lt;<code>dialog</code>&gt;</strong> representa un quadre de diàleg o un altre component interactiu, tal com un inspector o finestra.  Els elements <code>&lt;form&gt;</code>  poden integrar-se dins d'un diàleg especificant l'atribut <code>method="dialog"</code>. Quan s'envia un formulari, el diàleg es tancat amb un atribut <code>returnValue</code> establert en el valor del botó d'enviament utilitzat.</p>
+
+<p>El pseudo-element CSS {{cssxref('::backdrop')}} es pot utilitzar per donar estil el darrer d'un element <code>&lt;dialog&gt;</code>, per exemple per atenuar un contingut inaccessible mentre que està actiu un quadre de diàleg modal.</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories">Categories de contingut</a></th>
+ <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Contingut dinàmic</a>, <a href="/en-US/docs/Web/HTML/Sections_and_Outlines_of_an_HTML5_document#Sectioning_roots">seccionament arrel.</a></td>
+ </tr>
+ <tr>
+ <th scope="row">Contingut permès</th>
+ <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Contingut dinàmic.</a></td>
+ </tr>
+ <tr>
+ <th scope="row">Omissió de l'etiqueta</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Elements pares permesos</th>
+ <td>Qualsevol element que accepti <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">contingut dinàmic.</a></td>
+ </tr>
+ <tr>
+ <th scope="row">Interfície DOM</th>
+ <td>{{domxref("HTMLDialogElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Atributs">Atributs</h2>
+
+<p>Aquest element inclou els <a href="/en-US/docs/Web/HTML/Global_attributes">atributs globals</a>. <span id="result_box" lang="ca"><span>L'atribut</span> <code><span>tabindex</span></code> <span>no ha de ser</span> <span>utilitzat</span> <span>en l'element</span> <code><span>&lt;</span><span>dialog</span><span>&gt;</span></code><span>.</span></span></p>
+
+<dl>
+ <dt>{{htmlattrdef("open")}}</dt>
+ <dd>Indica que el diàleg és actiu i disponible per a la interacció. Quan l'atribut obert no està establert, no s'ha de mostrar a l'usuari.</dd>
+</dl>
+
+<h2 id="Exemples">Exemples</h2>
+
+<h3 id="Example_1">Example 1</h3>
+
+<pre class="brush: html">&lt;dialog open&gt;
+ &lt;p&gt;Greetings, one and all!&lt;/p&gt;
+&lt;/dialog&gt;
+</pre>
+
+<h3 id="Example_2">Example 2</h3>
+
+<pre class="brush: html">&lt;!-- Simple pop-up dialog box, containing a form --&gt;
+&lt;dialog id="favDialog"&gt;
+ &lt;form method="dialog"&gt;
+ &lt;section&gt;
+ &lt;p&gt;&lt;label for="favAnimal"&gt;Favorite animal:&lt;/label&gt;
+ &lt;select id="favAnimal"&gt;
+ &lt;option&gt;&lt;/option&gt;
+ &lt;option&gt;Brine shrimp&lt;/option&gt;
+ &lt;option&gt;Red panda&lt;/option&gt;
+ &lt;option&gt;Spider monkey&lt;/option&gt;
+ &lt;/select&gt;&lt;/p&gt;
+ &lt;/section&gt;
+ &lt;menu&gt;
+ &lt;button id="cancel" type="reset"&gt;Cancel&lt;/button&gt;
+ &lt;button type="submit"&gt;Confirm&lt;/button&gt;
+ &lt;/menu&gt;
+ &lt;/form&gt;
+&lt;/dialog&gt;
+
+&lt;menu&gt;
+ &lt;button id="updateDetails"&gt;Update details&lt;/button&gt;
+&lt;/menu&gt;
+
+&lt;script&gt;
+ (function() {
+ var updateButton = document.getElementById('updateDetails');
+ var cancelButton = document.getElementById('cancel');
+ var favDialog = document.getElementById('favDialog');
+
+ // Update button opens a modal dialog
+ updateButton.addEventListener('click', function() {
+ favDialog.showModal();
+ });
+
+ // Form cancel button closes the dialog box
+ cancelButton.addEventListener('click', function() {
+ favDialog.close();
+ });
+
+ })();
+&lt;/script&gt;
+</pre>
+
+<h2 id="Especificacions">Especificacions</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificació</th>
+ <th scope="col">Estat</th>
+ <th scope="col">Comentari</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'forms.html#the-dialog-element', '&lt;dialog&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', 'interactive-elements.html#the-dialog-element', '&lt;dialog&gt;')}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td>Definició inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Navegadors_compatibles">Navegadors compatibles</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>37</td>
+ <td>{{CompatNo}}<sup>[1]</sup></td>
+ <td>{{CompatNo}}</td>
+ <td>24</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td><span class="short_text" id="result_box" lang="ca"><span>Punts</span> <span>d'ancoratge</span></span></td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>37</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td><span class="short_text" id="result_box" lang="ca"><span>Punts</span> <span>d'ancoratge</span></span></td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] See {{bug("840640")}}.</p>
+
+<h2 id="Veure">Veure</h2>
+
+<ul>
+ <li>L'event {{event("close")}}</li>
+ <li>L'event {{event("cancel")}}</li>
+ <li><a href="/en-US/docs/Web/Guide/HTML/Forms">Guía formularis HTML</a>.</li>
+</ul>
+
+<div>{{HTMLRef}}</div>