[SharePoint 2010] Missing Scrollbars in Google Chrome

On one of my SharePoint sites that has a heavily customized master page users couldn’t scroll in Google Chrome. The page would load normally, however, there was no scrollbar to reach the content below the fold. Upon investigation, I discovered that the tag had an attribute turning off scrolling:

<body scroll="no" ...>

By simply removing that attribute, scrolling was enabled in Google Chrome. I’m not sure of the reasoning behind that tag, my only assumption is that it lets the whole page load first and then some SharePoint JavaScript re-enables scrolling after the page has finished loading.

I have not noticed any adverse effects by removing that attribute. Hopefully you find this useful.

UPDATE

Here is a very simply JavaScript method to accomplish this that you can add to the SharePoint master page (or use the method on [SharePoint 2010] Programmatically Add JavaScript, Meta Tags, and CSS Styles to the Header of Every Page):

function chromeFix() {
    // Check for Google Chrome
    if (navigator.userAgent.toLowerCase().indexOf('chrome') != -1) {
        var bodyElement = document.body;
        bodyElement.removeAttribute('scroll');
        if (typeof (_spBodyOnLoadWrapper) != 'undefined') {
            _spBodyOnLoadWrapper();
        };
    }
}

chromeFix();

John Chapman

Hello, I'm John Chapman. I am a SharePoint Developer for Sitrion (formerly NewsGator) living in Denver, Colorado. I develop solutions using SharePoint and .NET, and I thrive on the challenge of writing code to overcome the impossible, annoying, or otherwise difficult obstacles.

More Posts - Website - Twitter - LinkedIn - Google Plus

  • JimH

    Thanks for the tip about the scroll=no attribute. Using Chrome on the Mac, the lack of scrollbars was driving me crazy. When I found that our Sharepoint administrator had no interest in making the appropriate customization, I did some more experimenting. I found that in my case it was the Flashblock extension that was causing the problem. Disabling it brings the scrollbars back, but you can also just use the Flashblock options to add the Sharepoint site to its white list.

    • http://www.sharepointjohn.com John Chapman

      I hadn’t tried Chrome on the Mac. It is possible that the Mac version behaves slightly different than the PC version with the scrollbar issue.

  • HowardG

    I have seen that refreshing the browser (after loading) also brings back the scrollbar in most cases. I just assumed this due to the quickloading features of Chrome, that the page wasn’t fully loading and displaying.

  • Gene

    Adblock Plus for Chrome has the same effect as Flashblock, you have to white list the domain to get the scrollbars back.