Skip Navigation

[Resolved] Toolset Masonry View is flickering during the loading of the page

This support ticket is created 3 years, 8 months 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by nathanB-3 3 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#2055709
flickering_view.png
not_flickering_view.png

Toolset masonry view is flickering during the loading of the page causing a bad user experience and high content layout shift.

You can see how the flickering works in the screenshot, a live example is hidden link

I wonder what library toolset views is using for masonry, if there is a fix or a way to add a nice animation when elements appear on the screen.

#2056093

Hello and thank you for contacting the Toolset support.

Toolset uses its own code for the masonry layout. It does not use any popular library for that.

I can see the issue, especially when browsing to the next page of the view. So, I'll suggest that you use the view's events to implement some kind of "hide-until-it-is-ready" solution. For example, you can add a custom style(based on a class selector), that will hide the contents of the view until the results are loaded and added to the page.
https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax/

Something like:


jQuery( document ).on( 'js_event_wpv_parametric_search_started', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	*/
	// Execute code that will hide the contents
	// For example add a class to the view wrapper div.
});

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.effect (string) The View AJAX pagination effect
	* data.speed (integer) The View AJAX pagination speed in miliseconds
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	// Execute code that will show the contents
	// For example remove a class from the view wrapper div.
});

I hope this helps. Let me know if you have any questions.

#2056095

My issue is resolved now. Thank you!