Search Results for 'Masonry'

Forums › Forums › Search › Search Results for 'Masonry'

Viewing 10 results – 71 through 80 (of 354 total)
  • Author
    Search Results

  • Trevor
    Participant

    I made an edit to the page to remove the shortcode element and replace it with a Text element, with this in it:

    [searchandfilter id="2017"][searchandfilter id="2017" action="filter_next_query"]
    <script>(function ( $ ) {
    	"use strict";
    	
    	// detects when the ajax request has finished and the content has been updated
    	// re-init the layout scripts from Elementor
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    		elementorFrontend.hooks.doAction('frontend/element_ready/posts.cards', jQuery('.elementor-widget-posts'));
    	});
    	
    }(jQuery));</script>

    I also enabled Masonry for the Post Grid (without which there is an issue with images).

    #218932

    In reply to: No filter result


    Anonymous
    Inactive

    Hi Trevor,

    1. Update on the “ajax complete” issue
    I used the following code and the masonry is reloaded now. Not sure if it is the best solution though. Please feel free to advise.
    $(document).ajaxComplete(function() {
    loadMasonry();
    });

    2. Slow loading speed on mobile
    I unchecked the options “Post Type Archives”, “Tag, Category & Taxonomy Archives” and “Author Archives” on the settings page and the page speed has instantly improved on mobile. Are there any other options that I can turn off to improve the page speed further?

    Thanks,
    Anna

    #218874

    In reply to: No filter result


    Trevor
    Participant

    Is it even logging ajax complete to the console? If it is not, then the code may need to be different. Assuming the loadMasonry function finishes before the loadMasonry() call, our code would need to be this:

    (function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxformfinish", ".searchandfilter", function(){
        console.log("ajax complete");
        loadMasonry();
      });
    }(jQuery));
    #215561

    Trevor
    Participant

    It might be a number of things, but most likely you have one or both of:

    Lazyload images (such as in Jetpack; it is an option you can disable)
    the grid might be ‘powered’ by Masonry (Isotope), in which case the grid would need to have the Masonry script re-triggered to re-build the grid correctly.

    Are you able to send me a live link/URL to your search page so I can take a look?

    #213292

    Trevor
    Participant

    Are you using Masonry in Post Grid?

    #211639

    Anonymous
    Inactive

    So this is only needed when masonry is used as the layout, the above javascript is used to recreate the masonry after an Ajax reload but the pagination fails – as the pagination is outside of the main post masonry grid.

    1) Override the BB Post Grid Module…
    https://kb.wpbeaverbuilder.com/article/624-cmdg-18-override-built-in-modules

    2) Change the markup to move pagination in frontend.php in the new overridden module…
    https://gist.github.com/neilgee/938e8e3b66ad759edbeb02a27f0339fc

    3) Overview tutorial…
    https://wpbeaches.com/add-search-filter-pro-with-ajax-reload-to-beaver-builder-post-masonry-grid/

    #211511

    Anonymous
    Inactive

    Got it working with the help of BB support…

    
    jQuery(document).ready(function($){
        
    // detects the end of an ajax request being made
    $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    
       refreshGridLayout();
        
    });
    
    /**
     * Public method for refreshing Masonry within an element
     *
     * @since 1.8.1
     * @method refreshGridLayout
     */
    function refreshGridLayout() {
        
        var $element         = $( '.fl-module-post-grid' ),
             msnryContent    = $element.find('.masonry'),
             postItem       = $element.find('.fl-post-grid-post');
        
        if ( msnryContent.length ) {
            $element.imagesLoaded(function () {
                msnryContent.masonry('reloadItems');
                msnryContent.masonry('layout');
                postItem.css('visibility', 'visible');
            });
        }
            
    });
    

    The pagination becomes borked but by overriding the post-grid module and moving the pagination markup into the main fl-post-grid container fixes it up.

    #211243

    Anonymous
    Inactive

    Yes trying with some support on Beaver Builder slack but not there yet – this is where I am up to…

    
        /**
         * Public method for refreshing Masonry within an element
         *
         * @since 1.8.1
         * @method refreshGridLayout
         */
        function refreshGridLayout() {
            
            var $element         = $( '.fl-post-grid' ),
                 msnryContent    = $element.find('.fl-post-grid-post');
                 
                 //running images loaded again after page load / ajax event 
            $element.imagesLoaded(function () {
                // INITIALIZE MASONRY
                $element.masonry({
                    itemSelector: '.fl-post-grid-post',
                    columnWidth: '.fl-post-grid-post',
                    gutter: 40,
                });
                
                $element.masonry('reloadItems');
                        
                });
        }

    I can see the callbacks working via console log alerts but the masonry layout is not rebuilt and no JS errors via console.

    #211223

    Anonymous
    Inactive

    Hi,
    Any thoughts on how to refresh Masonry layout from a Beaver Builder Posts Module Layout with Masonry – currently layout is not refreshed after call and appears blank.

    I am trying to hook a callback like so…

    
    // detects the end of an ajax request being made
    $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        refreshGridLayout();
    });
    
    	/**
    	 * Public method for refreshing Masonry within an element
    	 *
    	 * @since 1.8.1
    	 * @method refreshGridLayout
    	 */
    	function refreshGridLayout() {
    		var $element 		=  $( '.fl-module-post-grid' );
    			msnryContent	= $element.find('.masonry');
    
    		if ( msnryContent.length )	{
    			msnryContent.masonry('layout');
    		}
    	}
    

    Example – https://tovo.websitelove.net/lights/


    Trevor
    Participant

    This is some sample code to re-load masonry/Isotope:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    // so load your masonry script here again
      });
    }(jQuery));</script>
Viewing 10 results – 71 through 80 (of 354 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.