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

Images in firefox #80

Open
mariofonestar opened this issue Jul 18, 2024 · 1 comment
Open

Images in firefox #80

mariofonestar opened this issue Jul 18, 2024 · 1 comment

Comments

@mariofonestar
Copy link

I am encountering the following problem on my page.

When I use Firefox and try to view an enlarged image, the following happens, as shown in the attached screenshot.

Captura de pantalla 2024-07-18 084800

The small square does not capture the part of the image I am selecting at that moment.

This only happens the first time I hover over the image. The second time, the image changes size and displays correctly, as shown in this other screenshot.

Captura de pantalla 2024-07-18 090136

Here you have the link to this example: https://fonestar.com/en/sky-6-dome/

@payalord
Copy link
Owner

This issue occurs due to a combination of using the following styles:

#gallery img {
    object-fit: contain;
    aspect-ratio: 1 / 1;
}

and:

.xzoom-source img, .xzoom-preview img, .xzoom-lens img {
  object-fit: contain;
  aspect-ratio: 1/1;
}

Also compared to chrome Firefox doesn't render on first load 400x400 product image container. That is even possible to see on your screenshots, on the first one you can see that aspect ratio is not 1:1. On second same product's aspect has been changed to 1:1. While on Chrome browser on first load it renders this CSS style properly right away.

My suggestion to fix this issue is to eliminate the styles related to:

object-fit: contain;
aspect-ratio: 1/1;

Or find the proper combination of this styles that will work for both browsers and will not affect xzoom default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants