Agregar amp-anim


amp-anim


Incruste animaciones (gif, webp) en sus archivos AMP HTML. Los archivos de animación deben cargarse a través de HTTPS.

Agregar

Importe el componente amp-anim justo después de la apertura <head>


<script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js"></script>


Uso básico

Un embed básico. El uso de amp-anim es similar al de amp-img.


Ejemplo

<amp-anim width="245"   height="300"   src="/img/gopher.gif"   alt="an animation"   attribution="The Go gopher was designed by Reneee French and is licensed under CC 3.0 attributions."> </amp-anim>

Puede utilizar amp-img como marcador de posición cuando la carga del archivo src lleva tiempo. El atributo placeholder de posición se debe asignar en amp-img en este caso.


Ejemplo

<amp-anim width="245"   height="300"   src="/img/gopher.gif"   alt="an animation"   attribution="The Go gopher was designed by Reneee French and is licensed under CC 3.0 attributions.">   <amp-img placeholder     width="245"     height="300"     src="/img/gopher.png">   </amp-img> </amp-anim>



Share:

Related post

Comentarios

Disqus

Disqus comments:


Facebook

Facebook comments: