Page up/down keys not working on pages with sharepoint ribbon (SP2010)

80 views Asked by At

On pages where we have SP ribbon, user is unable to scroll up/down using the PageUp/Down keys. It is only after clicking on the page, that these keys function properly. Can anyone tell the reason and resolution for this behavior. Appreciate an early reply, thanks in advance !!

1

There are 1 answers

0
PALLAVI SHARMA On

Tried to set the focus on body.. did the trick for me !!

function focusOnWorkspace() {
                var bodyCssClass = document.getElementsByTagName('body')[0].className;
                if (bodyCssClass != null ){
                    ExecuteOrDelayUntilScriptLoaded(function () {
                        document.getElementById('s4-workspace').focus();
                    }, 'core.js');
                }
            }
            $(document).ready(function () {
                _spBodyOnLoadFunctionNames.push('focusOnWorkspace');
            });