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

Example of simple multi-serve setup #69

Closed
fluxxus opened this issue Dec 5, 2015 · 6 comments
Closed

Example of simple multi-serve setup #69

fluxxus opened this issue Dec 5, 2015 · 6 comments

Comments

@fluxxus
Copy link

fluxxus commented Dec 5, 2015

I believe I got the setup correctly, it works as expected. Except one thing, the correct image is not showing on iPad mini retina.

Here is the setup:

 var bLazy = new Blazy({ 
            breakpoints: [{
                width: 900 // max-width
                , src: 'data-src-small'
            }
                         ]

        });

Small image is loaded for devices < 900, and regular image that is stored in data-src is provided for all other resolutions.

This is not working on iPad mini retina(landscape), it shows the smaller image, although clearly it should be serving the regular version through data-src="regular-image.jpg".

@dinbror
Copy link
Owner

dinbror commented Dec 9, 2015

hey @madebym

I don't have an ipad mini retina :/ But yes, I would also think it took the larger regular one.
Can you test what screen width it outputs: window.screen.width

A fix in the meantime would be adding a retina image(the larger one) for your 900 breakpoint (http://dinbror.dk/blog/blazy/#Retina):

     <img data-src-small="image.jpg|retina-image.jpg" ... />

@dinbror
Copy link
Owner

dinbror commented Jan 13, 2016

Friendly ping @madebym

Can you test what screen width it outputs: window.screen.width

@fluxxus
Copy link
Author

fluxxus commented Jan 22, 2016

@dinbror Sorry for the late reply.

Very confusing things are happening.

If I use window.screen.width I get: 768px for portrait and 768px for landscape. When using window.innerWidth I get 980px for portrait and 1024px for landscape.

Correct sizes should be 768 x 1024, nevermind that this is a retina screen and the actual resolution is twice that size.

I'll run some more tests, there are many JS ways of checking for width and height.

@fluxxus
Copy link
Author

fluxxus commented Jan 22, 2016

I've found one nice site that gets the dimensions with all the possible ways in JS.

Here are two screenhots attached, one for each device orientation.

img_0097
img_0098

@dinbror
Copy link
Owner

dinbror commented Jan 31, 2016

Hey @madebym

Thanks for the testing results.
Strange that window.screen.width returns 768px in landscape mode.
I'll try to dig more into it.

@dinbror
Copy link
Owner

dinbror commented Apr 30, 2016

Breakpoints marked as obsolete in version 1.6.0. Use srcset and/or the picture element instead.

@dinbror dinbror closed this as completed Apr 30, 2016
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