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

Using Foundation with Masonry #15

Open
natanio opened this issue Dec 13, 2014 · 2 comments
Open

Using Foundation with Masonry #15

natanio opened this issue Dec 13, 2014 · 2 comments

Comments

@natanio
Copy link

natanio commented Dec 13, 2014

Hi guys, I'm working on an app that uses zurb foundation for frontend design, as well as masonry-rails.

The two don't seem to be playing well together, unfortunately. When I remove the call to foundation's js, masonry works perfectly, but with the js included, masonry fails to reinitialize when the back button is clicked.

You can take a look at this problem at http://alpha.fluentli.com/languages.

To mimic the issue, just click on any language, then click the back button. You'll see that the language boxes are not formatted with masonry.

I thought this could be a problem with turbolinks, but removing it did nothing.

The coffee script I'm using is very simple, so I don't think there's any problem with the way I'm calling masonry:

$ ->
  $('#pins').masonry
    itemSelector: '.box'
    isFitWidth: true

Any tips, ideas, or other suggestions you could offer would be much appreciated! Thank you for the help.

@dariozac
Copy link

dariozac commented Jan 6, 2015

$('#pins').imagesLoaded -> is missing

so you can try

$ ->
$('#pins').imagesLoaded ->
$('#pins').masonry
itemSelector: '.box'
isFitWidth: true

I hope this helps..... I actually have a problem with the boxes not floating to fill the container and staying vertical - if you know of any gotcha

@natanio
Copy link
Author

natanio commented Jan 6, 2015

Thanks! I had tried having it with imagesLoaded before, but it doesn't change it.

It's hard to know what problem you're having without seeing your set up. Double check to make sure the right container is being called to be filled. I had problems with nesting containers before.

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