When used in conjunction with the Picture Module, the items in the grid overlap.
You can see what the overlap looks like here: http://i.imgur.com/NaK9GS8.png
I created a masonry view to display an image, a title and a trimmed body. When the image formatter is Picture, the overlap occurs. When the image formatter is Image, it works like a charm. I dug around the HTML and couldn't determine what was causing the overlap (granted I'm not as advanced a user as many of you are).
I know I could get around this issue by just using Image as the formatter, but it because it sounds like the Picture Module will be a significant piece of Drupal 8, I thought I'd bring it up.
Issue fork masonry-1996570
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #0.0
mgwisni commentedFixing the picture
Comment #1
mgwisni commentedAnother interesting piece to this is that when I adjust the page size and the grid changes, then there isn't overlap. The overlap only occurs on the initial page load.
Comment #2
mgwisni commentedThis issue was fixed for me by changing the initialize masonry script to the code found here: https://drupal.org/node/1806628#comment-7399254
Comment #3
thomaskrooshof commentedI have the exact same issue. Masonry bricks are glued together and in some cases overlapping each other. When i adjust the screen size they snap to the correct margins. In my case the Picture module is not installed.
I tried overwriting the views.module with the code from the post mentioned above (https://drupal.org/node/1806628#comment-7399254). For me this had no effect.
I tried to disable other jQuery modules like Lightbox2 and Search Autocomplete but without effect.
Any help is much appreciated.
Here is the link: http://www.laserpentina.nl/categorie/attributen
Comment #4
thomaskrooshof commentedI have switched to fields instead of teaser display and now it is behaving a bit better. I also had to remove almost all styling for the individual 'brick' wrapper, as soon as i add a padding, margin, border or width, the bricks will act as if they are three times as big as they actually are.
I now only have a background color and all styling is applied to my fields. For fields i cannot use margins as they are not used for the calculation, it will make the bricks glue together again.
Besides not being able to apply styling the only problem i have now is that the last row is sometimes not aligned to the left. It sticks to the middle or right side, as seen on the link i posted in the above message.
If anyone has a clue what is going on then please enlighten me.
- Thomas
Comment #5
jrcholtz commentedI used css to give the element a min-height, this stopped the overlapping for me....
Comment #5.0
jrcholtz commentedPicture issues
Comment #6
hoangdk80 commentedSame here.
I don't have picture installed.
I have twitter bootstrap installed.
I guess it is due to the css max-width on images.
For me it doesn't happened in firefox.
I think that things happened this way:
I resize my window,
browser shrink the last image element of the row if the row is larger than 100%,
masonry calculate the image height of the shrinked image,
masonry dispatches the images in their new position and sizes,
browser readjust the images
If I set in css images to max-width: none; it does the trick.
However in some case it still need to have this css.
In javascript I can bind masonry('reload') method on resize with a small delay. It does the trick but it's really overkill and the animation is laggy.
Comment #7
laborouge commentedHello,
Overlaping items are caused by items that change size after a layout.
You need to initiate Masonry after all images are loaded.
I fix it using Jquery to call my custom mansory galery !
In yout JS Script don't call $(document).ready(function(){ }); but jQuery(window).on('load', function(){ });
I found this solution here : http://stackoverflow.com/questions/18849296/masonry-js-overlapping-items
Comment #8
dom. commentedIt should work with version 3 since it is using imagesloaded library.
Please update and have a try, reopen and assign to version 3 if still having the issue.
Thanks for understanding.