Shop Categories

X

Workaround for scrollbars not working properly when using wpbakery post grid

Home Forums Agama Pro Workaround for scrollbars not working properly when using wpbakery post grid

Topic Resolution: Not a Question
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7983
    elwielan
    Participant

    We came across a problem when we were using Post Grid from WPbakery Page Builder (Visual Composer): Because the Post Grid is loaded via AJAX after everything else, the nicescroll plugin does not see that the page’s length has changed. And therefore might not show any scrollbar. Scrolling is impossible, although one can see that the content is “cut” at the bottom of the browser’s windows.

    Just posting our solution here in case someone else comes accross the same problem. The WPbakery developers announced 2 weeks ago that they will provide a non-ajax version of Post Grid in the future.

    This is the workaround we use. It is stored inside a .js file.

    jQuery('document').ready(function(){
       jQuery(document).on('mouseover','html', function () {
           jQuery(this).getNiceScroll().resize();
        });
    });

    This file is then loaded via functions.php:

    function add_my_other_script() {
        wp_enqueue_script( 'nice-scroll-patch', get_stylesheet_directory_uri() . '/js/NiceScrollPatch.js', array('jquery') );
    }
    add_action( 'wp_enqueue_scripts', 'add_my_other_script' );
    #7984
    elwielan
    Participant

    P.S.: Disabling soft scrolling (Customizer>General>Extras>Soft Scrolling) is of course also a solution.

    #7998
    Zex
    Moderator

    Hi, elwielan!

    Thank you for the workaround.

    Best Regards

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.