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' );