• Resolved littlescrat79

    (@littlescrat79)


    Hello guys,

    i discovered a bug in this plugin. Description: When you click the “Load more”-button then Firefox (v51.0.1) jumps to the top, instead of resting at the position where you clicked.

    In the javascript-file “grid.js” at /wp-content/plugins/wp-ultimate-post-grid-premium/core/js i made changes at line 668 and line 677. At line 668 firefox return 0 for the variable scrollV so it jumps simply to the top after clicking the buton. Also at line 677 firefox does not recognize the “scrollTop”-property.

    Now the “insertPosts”-method looks like:

    WPUltimatePostGrid.insertPosts = function(grid_id, posts) {
    	//2017-02-02 - bugfixing for firefox get scrollV value
        var scrollV = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
            scrollH = document.documentElement.scrollLeft || document.body.scrollLeft;
    	
        WPUltimatePostGrid.grids[grid_id].container.isotope('destroy');
    
        WPUltimatePostGrid.grids[grid_id].container.append(posts);
        WPUltimatePostGrid.grids[grid_id].container.isotope(WPUltimatePostGrid.grids[grid_id].args);
    
        // Restore the scroll offset, should be flicker free
        //2017-02-02 - bugfixing for firefox -> scrollV
    	//document.documentElement.scrollTop = document.body.scrollTop = scrollV;
    	jQuery(window).scrollTop(scrollV);
        document.documentElement.scrollLeft = document.body.scrollLeft = scrollH;
    	
        WPUltimatePostGrid.updatePosts(grid_id);
        WPUltimatePostGrid.checkLinks(grid_id);
        WPUltimatePostGrid.filterGrid(grid_id);
    
        WPUltimatePostGrid.grids[grid_id].container.imagesLoaded( function() {
            WPUltimatePostGrid.grids[grid_id].container.isotope('layout');
            WPUltimatePostGrid.grids[grid_id].loading = false;
        });
    };

    Now it works. I hope this helps someone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brecht

    (@brechtvds)

    Thank you for the report and the code. I’ll look into it for the next update!

    Brecht

    Plugin Author Brecht

    (@brechtvds)

    We included this fix (and others) in our latest 2.4 update. It seems to be working fine for me in Firefox now.

    Kind regards,
    Brecht

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Firefox ignoring scrollTop’ is closed to new replies.