diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/ca/web/html/element/dialog/index.html | |
parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
download | translated-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.html | 208 |
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 <<code>dialog</code>></strong> representa un quadre de diàleg o un altre component interactiu, tal com un inspector o finestra. Els elements <code><form></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><dialog></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><</span><span>dialog</span><span>></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"><dialog open> + <p>Greetings, one and all!</p> +</dialog> +</pre> + +<h3 id="Example_2">Example 2</h3> + +<pre class="brush: html"><!-- Simple pop-up dialog box, containing a form --> +<dialog id="favDialog"> + <form method="dialog"> + <section> + <p><label for="favAnimal">Favorite animal:</label> + <select id="favAnimal"> + <option></option> + <option>Brine shrimp</option> + <option>Red panda</option> + <option>Spider monkey</option> + </select></p> + </section> + <menu> + <button id="cancel" type="reset">Cancel</button> + <button type="submit">Confirm</button> + </menu> + </form> +</dialog> + +<menu> + <button id="updateDetails">Update details</button> +</menu> + +<script> + (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(); + }); + + })(); +</script> +</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', '<dialog>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5.1', 'interactive-elements.html#the-dialog-element', '<dialog>')}}</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> |