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

Basic instructions not working...? #3

Open
impressivewebs opened this issue Nov 14, 2019 · 3 comments
Open

Basic instructions not working...? #3

impressivewebs opened this issue Nov 14, 2019 · 3 comments

Comments

@impressivewebs
Copy link

Hi, your tool seems nice in the demo on the home page, but I can't figure out how a basic demo is supposed to be set up from scratch.

For example:

https://codepen.io/impressivewebs/pen/rNNqgEM?editors=0010

I believe I've done whatever the instructions say, but I'm not seeing anything resembling a responsive grid that fits in the viewport. Am I supposed to do something to prevent the horizontal scroll bars? When I add a max-width to the container, it doesn't seem to help.

It might be good to include a demo with the unsplash images that looks practical and usable...? Just my two cents, but certainly my limited understanding of this library might be the main culprit here. Thanks.

@gilbitron
Copy link
Owner

If you're loading a page with images I suggest using something like https://imagesloaded.desandro.com and calling FlexMasonry.refreshAll(); once all of the images have loaded.

@impressivewebs
Copy link
Author

Is that because you're concerned that the images should be loaded first? If that's the case then I should just be able to do:

window.onload = function () {
  FlexMasonry.refreshAll();
};

But that still doesn't fix the problem. I've even tried adding a timer delay before refreshing, and it still doesn't do anything different. I think you should set up a working demo that's based on the basic instructions, so users can play around with it.

@JoshuaCrewe
Copy link

@impressivewebs what about containing the images to the column width ?

img { 
  max-width: 100%;
  height: auto;
}

I did it on that pen and got some mixed results. When resizing the window it worked fine. Sometimes on load I'd get some gaps between the images. I think this is related to the PR which is open (#4) so adding

.grid {
    align-content: flex-start;
}

would get rid of those gaps I believe.

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

3 participants