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

Incorrect size loaded with srcset and sizes above 100vw #100

Open
faebe opened this issue Sep 20, 2016 · 0 comments
Open

Incorrect size loaded with srcset and sizes above 100vw #100

faebe opened this issue Sep 20, 2016 · 0 comments

Comments

@faebe
Copy link

faebe commented Sep 20, 2016

This problem occurs with version 1.1.0, version 1.0.6 seems to work just fine.

I'm using lazy-load-xt extra with the srcset plugin. Images have sizes above 100vw, because some are scaled larger than the screen in order to allow certain animations.

HTML example:

<img src="http://mypage.com/images/placeholder.gif" srcset="" data-src="http://mypage.com/900x600.jpg" data-srcset="http://mypage.com/450x300.jpg 450w, http://mypage.com/700x467.jpg 700w, http://mypage.com/1400x933.jpg 1400w, http://mypage.com/900x600.jpg 900w, http://mypage.com/1800x1200.jpg 1800w, http://mypage.com/1440x960.jpg 1440w, http://mypage.com/1920x1280.jpg 1920w, http://mypage.com/2400x1600.jpg 2400w, http://mypage.com/1728x1152.jpg 1728w, http://mypage.com/2800x1867.jpg 2800w" sizes="(min-width: 1024px) 100vw, (min-width: 768px) 150vw, 200vw" class="lazy lazy-hidden">

As you can see, there are sizes above 100vw:
(I need those to animate the image over time on smaller screens)

sizes = '(min-width: 1024px) 100vw, (min-width: 768px) 150vw, 200vw'

Version 1.1.0 fails on a 375px wide screen and loads 450x300.jpg. With a image-width of 200vw (=750px on a 375px device) this is way too small. Version 1.0.6 does everything correct and loads 900x600.jpg.

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

1 participant