5/11/2017

Bagaimana cara menggunakan amp-anim diblog AMP Html


amp-anim


Sematkan animasi (gif, webp) di file HTML AMP Anda. File animasi harus diunggah melalui HTTPS.

Cara Penambahan

Impor komponen amp-anim sesaat setelah pembukaan <head>


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


Penggunaan dasar

Penggunaan amp-anim mirip dengan amp-img.


Contohnya

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

Anda dapat menggunakan amp-img sebagai placeholder saat memuat file src membutuhkan waktu. Atribut placeholder posisi harus ditetapkan dalam amp-img dalam kasus ini.


Contohnya

<amp-anim width="245"   height="300"   src="/img/gopher.gif"   alt="sebuah animasi"   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

You Might Also Like:

Disqus comments:


Facebook comments: