Kunjungi Blog terbaru saya corkismet - Coretan Kang Ismet - dan tinggalkan jejak sobat disana.

Mengatasi amp-iframe Error / Tidak Muncul

Cara mengatasi iframe yang Error pada AMP HTML
Bagi sobat pengguna AMP HTML, tentunya sudah mengetahui apa itu amp-iframe. Amp-iframe merupakan pengganti tag iframe pada template / theme AMP.

Beberapa kali saya mencoba mengiframe halaman, akan tetapi tetap halaman tidak muncul, hanya muncul indikator loading saja. Harap diingat, halaman yang diiframe harus menggunakan SSL (https).

Ternyata permasalahannya, AMP iframe tidak mengizinkan iframe, apabila amp-iframe kurang dari 600px dari atas halaman web /blog. Atau ketika di scroll ke atas, kurang dari 75%. Di AmpByExample sebetulnya sudah di jelaskan :

Iframes must be either 600px away from the top or not within the first 75% of the viewport when scrolled to the top – whichever is smaller. This example might not work depending on your screen width. In that case it will only show a loading indicator.

Jadi supaya tampil, iframe jangan terlalu atas. Batas dari Atas halaman harus melebihi 600px.

Amp-iframe bisa saja tidak muncul ketika dibuka pada layar yang lebih lebar, hal ini karena posisi objek / amp-iframe akan naik sehingga kurang dari 600px atau kurang dari 75% area scroll sebelum iframe.

Untuk mendapatkan update terbaru di Dasbor Blogger, silahkan ikuti Blog ini

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.