Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving amp-image-lightbox for desktop #24531

Closed
2shrestha22 opened this issue Sep 15, 2019 · 7 comments
Closed

improving amp-image-lightbox for desktop #24531

2shrestha22 opened this issue Sep 15, 2019 · 7 comments

Comments

@2shrestha22
Copy link

Describe the new feature or change to an existing feature you'd like to see

When AMP is used in desktop version the amp-image-lightbox effect cause small images to stretch. Images tends to fill the whole screen but in desktop this feature makes images ugly. Is there any way not to exceed width and height of images?

Describe alternatives you've considered

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@stefany-newman
Copy link

^^ I think the whole point of the lightbox is to provide a higher resolution image to the user on click. so you need to supply a higher resolution pic and if not, you don't need a lightbox.

I could be wrong tho.

@2shrestha22
Copy link
Author

Yes it is. But the things is that lightbox is enabled by default in all images including featured image and small screenshots images that I use. Any way to avoid auto enabled lightbox?

@stefany-newman
Copy link

Are you sure you are not talking about amp-image-gallery ? With amp-img-lightbox you have to manually specify which images to be lightboxed.

@2shrestha22
Copy link
Author

2shrestha22 commented Sep 16, 2019

Yes; it was not happening before. I was manually enabling lightbox effect while editing post. Here is my site - https://sangams.com.np/

@alanorozco
Copy link
Member

alanorozco commented Sep 16, 2019

@2shrestha22

You can disable auto lightbox by setting the data-amp-auto-lightbox-disable attribute on any element. Set it on <body> to disable for the whole document.

Additionally, if you include the amp-lightbox-gallery extension script and use it explicitly by setting the lightbox attribute on a valid element, auto-lightbox won't apply.

@2shrestha22
Copy link
Author

@alanorozco

Thanks for the solution. Is it possible to makes image not fill the width and height instead show actual size of image.

@cathyxz
Copy link
Contributor

cathyxz commented Sep 30, 2019

@2shrestha22 I think that's probably a better use case for amp-lightbox than for amp-image-lightbox or amp-lightbox-gallery. Would styling your image for amp-lightbox work in this case?

derat added a commit to derat/intransigence that referenced this issue Jun 17, 2022
This disables weird behavior where AMP displays a zoomed-in,
blurry lightbox when an <amp-img> that doesn't already have
a click handler is clicked. It also prevents an
<amp-lightbox-gallery> element from being automatically
created. See https://stackoverflow.com/q/58276934 and
ampproject/amphtml#24531.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants