Skip Navigation

[Resolved] Issues with masonry views after page reload

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by neijibB 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#1629101
masonry-ok.jpg
masonry-broken.jpg

Hello Toolset Team,

I am using the masonry grid to display posts. After selecting filters, the items overlay each other.

It looks like the masonry grid load before the images have finished loading.

If I resize the window of my browser, the masonry grid correctly reset itself.

Do you have a suggested work around? For instance, a simple script to reload the masonry grid after the images are correctly loaded?

REF
hidden link

#1629343

Hi, I can try to help. The solution may depend on the other systems at work here. Are you using any external scripts for images, like a lazy load plugin or other custom code? For example, if you deactivate all 3rd party plugins except Types and Views, and activate a default theme like Twenty Twenty, is the problem still occurring?

#1632411

My issue is resolved now.

We implemented the following fix:
1) We initially hide the Toolset view with a CSS code. We added the class to the columns where we had our Toolset view (under advanced/additional class).
2) We resize the window to force a fix on the masonry

--------------

/*CSS*/
.masonry-on-the-views {
visibility: hidden;
}

/*JS*/
setTimeout(function() {
jQuery(".masonry-on-the-views").css("visibility", "visible");
window.dispatchEvent(new Event('resize'));
}, 1000);