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

blazy does not change images source on window resize #67

Closed
nntgwww opened this issue Nov 4, 2015 · 2 comments
Closed

blazy does not change images source on window resize #67

nntgwww opened this issue Nov 4, 2015 · 2 comments

Comments

@nntgwww
Copy link

nntgwww commented Nov 4, 2015

I have tested it on my local. Image won't change source when window resize. I looked at demo page and try to resize window. But when it first load big-bear, it won't load small-bear image below 420px;

<img src=data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
                                     data-src="/assets/images/banner-1-lg.jpg"
                                     data-src-sm="/assets/images/banner-1-sm.jpg"
                                     data-src-mobile="/assets/images/banner-1.jpg"
                                     class="b-lazy">
var bLazy = new Blazy({
        breakpoints: [{
            width: 480
            , src: 'data-src-mobile'
        }
            , {
                width: 767
                , src: 'data-src-xs'
            }
            , {
                width: 991
                , src: 'data-src-sm'
            }
        ]
    });
@dinbror
Copy link
Owner

dinbror commented Nov 4, 2015

Hey @nntgwww .

The breakpoints are defined by the device width not the browser width. It means that it’ll look at your screen width which won’t change when you resize your browser window.
The reason why I’m looking at the device width and not the width is that I don’t want to load multiple image sources for the same image when you resize (multiple server request per image). And if you have a big screen but the start width of your browser window is something small I don’t want to upscale a low res image if you resize it up.

@nntgwww
Copy link
Author

nntgwww commented Nov 5, 2015

Ok thank you for your reply. I want to achieve this because my layout will be broken if user resize the window (Row, Grid, Fluid will change order and images too...) also designer want to load different images for each screen size... If you can add this featured it will be good for case like me :).
Love ur plugin like bPopup very lightweight :)

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

2 participants