aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/css/transition-duration
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
commit1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch)
tree0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/css/transition-duration
parent4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff)
downloadtranslated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip
initial commit
Diffstat (limited to 'files/es/web/css/transition-duration')
-rw-r--r--files/es/web/css/transition-duration/index.html341
1 files changed, 341 insertions, 0 deletions
diff --git a/files/es/web/css/transition-duration/index.html b/files/es/web/css/transition-duration/index.html
new file mode 100644
index 0000000000..03f74d31d8
--- /dev/null
+++ b/files/es/web/css/transition-duration/index.html
@@ -0,0 +1,341 @@
+---
+title: transition-duration
+slug: Web/CSS/transition-duration
+translation_of: Web/CSS/transition-duration
+---
+<div>{{CSSRef}}</div>
+
+<p>La propiedad de <a href="/en-US/docs/Web/CSS">CSS</a> <strong><code>transition-duration</code></strong> establece el tiempo que debe tardar una animación de transición en completarse. Por defecto, el valor es de <code>0s</code>, esto quiere decir que no se producirá ninguna animación.</p>
+
+<div>{{EmbedInteractiveExample("pages/css/transition-duration.html")}}</div>
+
+<p class="hidden">La fuente de este ejemplo interactivo se almacena en un repositorio de GitHub. Si desea contribuir al proyecto de ejemplos interactivos, por favor clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> y envíenos un pull reques.</p>
+
+<p>Se puede especificar múltiples duraciones; cada duración va a ser aplicada a la propiedad correspondiente según lo especificado en la propiedad {{ cssxref("transition-property") }}, que actuará como una lista maestra. Si se especifican menos duraciones en la lista maestra, el agente de usuario repetirá la lista de duraciones. Si hay más duraciones, la lista simplemente se trunca al tamaño correcto. En ambos casos, la declaración CSS sigue siendo válida</p>
+
+<h2 id="Sintaxis">Sintaxis</h2>
+
+<pre class="brush:css no-line-numbers">/* &lt;time&gt; values */
+transition-duration: 6s;
+transition-duration: 120ms;
+transition-duration: 1s, 15s;
+transition-duration: 10s, 30s, 230ms;
+
+/* Global values */
+transition-duration: inherit;
+transition-duration: initial;
+transition-duration: unset;
+</pre>
+
+<h3 id="Valores">Valores</h3>
+
+<dl>
+ <dt><code>&lt;time&gt;</code></dt>
+ <dd>El {{cssxref("&lt;time&gt;")}} indica la cantidad de tiempo que debe tomar la transición del valor anterior de una propiedad, al nuevo valor. Un tiempo de 0s indica que no ocurrirá ninguna transición, es decir, el cambio entre los dos estados será instantáneo. Un valor negativo para el tiempo hace que la declaración sea inválida.</dd>
+</dl>
+
+<h3 id="Sintaxis_Formal">Sintaxis Formal</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Ejemplos">Ejemplos</h2>
+
+<div>
+<div id="duration_0_5s" style="width: 251px; display: inline-block; margin-right: 1px; margin-bottom: 1px;">
+<p><code>transition-duration: 0.5s</code></p>
+
+<div style="display: none;">
+<pre class="brush:html"> &lt;div class="parent"&gt;
+ &lt;div class="box"&gt;Lorem&lt;/div&gt;
+&lt;/div&gt;
+ </pre>
+
+<pre class="brush:css;">.parent { width: 250px; height:125px;}
+.box {
+ width: 100px;
+ height: 100px;
+ background-color: red;
+ font-size: 20px;
+ left: 0px;
+ top: 0px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:0.5s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:0.5s;
+ transition-timing-function: ease-in-out;
+}
+.box1{
+ transform: rotate(270deg);
+ -webkit-transform: rotate(270deg);
+ width: 50px;
+ height: 50px;
+ background-color: blue;
+ color: yellow;
+ font-size: 18px;
+ left: 150px;
+ top:25px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:0.5s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transformv color;
+ transition-duration:0.5s;
+ transition-timing-function: ease-in-out;
+}
+</pre>
+
+<pre class="brush:js">function updateTransition() {
+ var el = document.querySelector("div.box");
+
+ if (el) {
+ el.className = "box1";
+ } else {
+ el = document.querySelector("div.box1");
+ el.className = "box";
+ }
+
+ return el;
+}
+
+var intervalID = window.setInterval(updateTransition, 7000);
+</pre>
+</div>
+
+<div>{{EmbedLiveSample("duration_0_5s",275,150)}}</div>
+</div>
+
+<div id="duration_1s" style="width: 251px; display: inline-block; margin-right: 1px; margin-bottom: 1px;">
+<p><code>transition-duration: 1s</code></p>
+
+<div style="display: none;">
+<pre class="brush:html"> &lt;div class="parent"&gt;
+ &lt;div class="box"&gt;Lorem&lt;/div&gt;
+&lt;/div&gt;
+ </pre>
+
+<pre class="brush:css;">.parent { width: 250px; height:125px;}
+.box {
+ width: 100px;
+ height: 100px;
+ background-color: red;
+ font-size: 20px;
+ left: 0px;
+ top: 0px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top -webkit-transform color;
+ -webkit-transition-duration:1s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform color;
+ transition-duration:1s;
+ transition-timing-function: ease-in-out;
+}
+.box1{
+ transform: rotate(270deg);
+ -webkit-transform: rotate(270deg);
+ width: 50px;
+ height: 50px;
+ background-color: blue;
+ color: yellow;
+ font-size: 18px;
+ left: 150px;
+ top:25px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top -webkit-transform transform color;
+ -webkit-transition-duration:1s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:1s;
+ transition-timing-function: ease-in-out;
+}
+</pre>
+
+<pre class="brush:js">function updateTransition() {
+ var el = document.querySelector("div.box");
+
+ if (el) {
+ el.className = "box1";
+ } else {
+ el = document.querySelector("div.box1");
+ el.className = "box";
+ }
+
+ return el;
+}
+
+var intervalID = window.setInterval(updateTransition, 7000);
+</pre>
+</div>
+
+<div>{{EmbedLiveSample("duration_1s",275,150)}}</div>
+</div>
+
+<div id="duration_2s" style="width: 251px; display: inline-block; margin-right: 1px; margin-bottom: 1px;">
+<p><code>transition-duration: 2s</code></p>
+
+<div style="display: none;">
+<pre class="brush:html"> &lt;div class="parent"&gt;
+ &lt;div class="box"&gt;Lorem&lt;/div&gt;
+&lt;/div&gt;
+ </pre>
+
+<pre class="brush:css;">.parent { width: 250px; height:125px;}
+.box {
+ width: 100px;
+ height: 100px;
+ background-color: red;
+ font-size: 20px;
+ left: 0px;
+ top: 0px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:2s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:2s;
+ transition-timing-function: ease-in-out;
+}
+.box1{
+ transform: rotate(270deg);
+ -webkit-transform: rotate(270deg);
+ width: 50px;
+ height: 50px;
+ background-color: blue;
+ color: yellow;
+ font-size: 18px;
+ left: 150px;
+ top:25px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:2s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:2s;
+ transition-timing-function: ease-in-out;
+}
+</pre>
+
+<pre class="brush:js">function updateTransition() {
+ var el = document.querySelector("div.box");
+
+ if (el) {
+ el.className = "box1";
+ } else {
+ el = document.querySelector("div.box1");
+ el.className = "box";
+ }
+
+ return el;
+}
+
+var intervalID = window.setInterval(updateTransition, 7000);
+</pre>
+</div>
+
+<div>{{EmbedLiveSample("duration_2s",275,150)}}</div>
+</div>
+
+<div id="duration_4s" style="width: 251px; display: inline-block; margin-right: 1px; margin-bottom: 1px;">
+<p><code>transition-duration: 4s</code></p>
+
+<div style="display: none;">
+<pre class="brush:html"> &lt;div class="parent"&gt;
+ &lt;div class="box"&gt;Lorem&lt;/div&gt;
+&lt;/div&gt;
+ </pre>
+
+<pre class="brush:css;">.parent { width: 250px; height:125px;}
+.box {
+ width: 100px;
+ height: 100px;
+ background-color: red;
+ font-size: 20px;
+ left: 0px;
+ top: 0px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:4s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:4s;
+ transition-timing-function: ease-in-out;
+}
+.box1{
+ transform: rotate(270deg);
+ -webkit-transform: rotate(270deg);
+ width: 50px;
+ height: 50px;
+ background-color: blue;
+ color: yellow;
+ font-size: 18px;
+ left: 150px;
+ top:25px;
+ position:absolute;
+ -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color;
+ -webkit-transition-duration:4s;
+ -webkit-transition-timing-function: ease-in-out;
+ transition-property: width height background-color font-size left top transform -webkit-transform color;
+ transition-duration:4s;
+ transition-timing-function: ease-in-out;
+}
+</pre>
+
+<pre class="brush:js">function updateTransition() {
+ var el = document.querySelector("div.box");
+
+ if (el) {
+ el.className = "box1";
+ } else {
+ el = document.querySelector("div.box1");
+ el.className = "box";
+ }
+
+ return el;
+}
+
+var intervalID = window.setInterval(updateTransition, 7000);
+</pre>
+</div>
+
+<div>{{EmbedLiveSample("duration_4s",275,150)}}</div>
+</div>
+</div>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('CSS3 Transitions', '#transition-duration-property', 'transition-duration') }}</td>
+ <td>{{ Spec2('CSS3 Transitions') }}</td>
+ <td>Definición Inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="Compatibilidad_con_Navegadores">Compatibilidad con Navegadores</h2>
+
+<div class="hidden">La compatibilidad de la tabla se genera a partir de datos estructurados. Si usted quiere contribuir con estos datos, por favor va a <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> y envíenos un pull request.</div>
+
+<p>{{Compat("css.properties.transition-duration")}}</p>
+
+<h2 id="También_puede_ver">También puede ver</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions">Using CSS transitions</a></li>
+ <li>{{cssxref('transition')}}</li>
+ <li>{{cssxref('transition-property')}}</li>
+ <li>{{cssxref('transition-timing-function')}}</li>
+ <li>{{cssxref('transition-delay')}}</li>
+ <li>{{domxref("TransitionEvent")}}</li>
+</ul>