Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is not related to the other issue, which centered around a problem with images. In this case, the overlap happens on simple text-based posts. Strangely, after resizing the browser window, there are no issues. But on page refresh, it crops up again -- this is extremely problematic for us, because we're using an exposed filter to sort these items, and when we do a sort by "All" we reproduce the layout issues anew.
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2013-08-09 at 12.13.10 AM.png | 70.78 KB | threadsniper |
Comments
Comment #1
kyletaylored CreditAttribution: kyletaylored commentedSo this isn't really a patch as much as it is a quick fix. I've noticed this happening intermittently on one of our sites, but just add this to your template.php. Basically just reload Masonry after the window is finished loading. I didn't have much luck with jQuery(document).ready, but feel free to switch it out if you'd like.
Comment #2
threadsniper CreditAttribution: threadsniper commentedThanks for the assist Kyle!
Comment #4
MHz CreditAttribution: MHz commentedI'm having this problem. My views are behind tabs and when you click a table the masonry is all overlapped, I figured I need to reload masonry when I click on the tab. I tried
But it doesn't' seem to be doing anything, also the script is printed times in the html of my page which is weird.
Does anybody have any advice?
Comment #5
davidneedhamThis is definitely still an issue in the latest dev.
Comment #6
davidneedhamThis isn't a long term fix for the issues in the module, but I adopted the suggestion in #1 to work in my situation. Rather than adding this into the template.php, I added this into a javascript file into my theme. My issue was related to the masonry not automatically resizing properly when the width of the window was changed, so I changed $(window).load to $(window).resize.
Comment #7
kopeboy CreditAttribution: kopeboy commentedI tried the code in #1, but putting it in my theme script.js file like advised in #6.
Unfortunately it didn't solve the problem.
Comment #8
Dom. CreditAttribution: Dom. commentedThis is fixed in 3.x, except for @kopeboy #7 which is handled here:
#1835286: Masonry Grid broken under quicktabs or Bootstrap tabs
Comment #9
manop CreditAttribution: manop commentedI followed #1 by adding to the template.php file, it still didn't work for me. I got an error message in Chrome console showing that "masonry is not a function"
I even tried changing the code from the Masonry Library web. Someone said that in version 3, "reload" should be "reloadItems" instead.
My setting is listed below:
Masonry API 7.x-3.0-beta1
Masonry Views 7.x-3.0
Comment #10
Dom. CreditAttribution: Dom. commentedUsing latest Masonry API (the dev version), the issue should be fixed and #1 should not be needed, unless I did not understood the problem.
The point the "masonry is not a function" is probably you are either:
- not masonry properly set (check /admin/reports/status)
- your custom JS running before inclusion of masonry library JS (check out the page source code for ordering)
Dom.
Comment #11
manop CreditAttribution: manop commentedThanks Dom. I fixed my problem either way around.
If I choose "Load images first", it works fine with the same setting before. I don't know why when I unchecked "Load images first" options, all .masonry-item overlapped each other.
This is my site which I can temporary changed to show how thing overlapped
http://cmhop.finearts.cmu.ac.th/
Comment #12
daniel.skorski@pnnl.gov CreditAttribution: daniel.skorski@pnnl.gov commentedThanks everyone. This works really well now.
Comment #13
Dom. CreditAttribution: Dom. commented@manop: this is why this option exists. If Masonry fires before images are loaded, it does not have all data to compute the layout positionning since it does not know image sizes.
Comment #14
Andru CreditAttribution: Andru commentedI was experiencing mysterious occasional overlap problems with fitwidth on the latest dev version until I set Jquery to 1.10 instead of 1.9.