Questions tagged [amp-img]

A runtime-managed replacement for the HTML img tag. aims to replace the HTML tag in order to improve the load time in mobile devices. It is part of the AMP project. should by used by all sites that implements AMP project.

35 questions
4
votes
1 answer

How do I disable amp-img default lightbox functionality?

I have a lot of elements on a client's site and recently noticed a feature where you can click the image and get a lightbox that pops out with an X in the upper-right corner. I can't find ANY mention on their official documentation about…
4
votes
1 answer

Is there any way to use onerror() attribute in

Is there any way to use onerror attribute in ? It was working good in html. But amp html will create img tag inside amp-img
dom
  • 325
  • 2
  • 15
3
votes
1 answer

amp-img not showing in carousel

I used an AMP carousel to show a list of articles abstracts. For some reason only the abstracts which were visible at page load have pictures. ( If i rotate the screen more but not all pictures are loaded. ) What am i doing wrong? Feel free to ask…
Dorad
  • 3,413
  • 2
  • 44
  • 71
3
votes
3 answers

Place text inside an amp-img with layout="responsive"

I have an amp-img with layout="responsive" and I need to place some text inside it, or on top of it, if you prefer to say it that way. The amp-img will fill the width of the screen and the height will be determined by amp-img so that the entire…
Jim S
  • 1,069
  • 3
  • 10
  • 17
3
votes
2 answers

How to lazy load amp-img?

What is the approach for lazy loading images for pages that conform to the Google Accelerated Mobile Pages (AMP) project? It is my understanding that lazy loading means that the image is loaded to the client sometime after the above-the-fold content…
Bruce
  • 119
  • 2
  • 10
2
votes
0 answers

Animate amp-img through position-observer: Failing with clip-path... Am I dumb?

html workers. I am struggling with amp-html animation. I want to animate an amp-img as it enter the viewport. So far so good. We have done that. However: despite being referenced in the docs as working: This won't work. Pug code:
2
votes
0 answers

amp-img images not showing on iphone

I'm having an issue with images not loading on iPhone browsers. Works absolutely fine while testing through chrome and other browsers on Android phones. I keep getting the console error "Failed to load: image - v0.js:127" Below is the html code of…
Charles Syms
  • 63
  • 10
2
votes
0 answers

How to use webp in amp correctly

I'm wondering how to use webp in amp correctly. There is a sample form amp doc
Marv
  • 441
  • 2
  • 14
2
votes
3 answers

Use the first amp-img on the page for facebook share

I have a blogger website that I have recently migrated to amp-html. I am having problems with the usage of amp-img tag. Firstly blogger does not recognize the First amp-img as the first image of the post and fails to make the default thumbnail out…
2
votes
1 answer

Styling responsive layout in amp-img

Since I've implemented Google AMP I am struggling with this problem. Every time I add an image with a width far smaller than my website width, amp-img automatically add margins to keep the aspect ratio, like this: I have tried other layouts…
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
1
vote
0 answers

amp-carousel 0.2 shows the error "startLayout called but not LAYOUT_SCHEDULED currently: 2" when changing the screen resolution

When the screen resolution is changed, the console displays the message startLayout called but not LAYOUT_SCHEDULED currently: 2 and amp-img element is returned. If you stop and reload the page, the error disappears until you change the screen…
Varvara
  • 11
  • 1
  • 1
1
vote
1 answer

Is there a way to add multiple media queries to the `media` AMP attribute?

I'm trying to figure out the syntax for multiple media queries in the media attribute for amp components:
Hpeachey
  • 23
  • 3
1
vote
1 answer

Dynamic setState in AMP

I have amp-state like this: