Free Support Forum - groupdocs.com

Page up/down keys don't work when viewer is displayed


#1

Hi, I would like the page up and down keys to work after the viewer is displayed. If I click on the viewer widget, it gets focus and then the page up and down keys work to scroll the viewer contents.


Is there some way to automatically give the viewer widget focus when the page is displayed so that the page up and down keys work without having to click the viewer first?

Thanks, Bill

#2

Hello Bill,


Thank you fro your request. Yes, you can do that with jQuery. You can set focus on the document with this simple JavaScript code:
$(document).ready(function () {
$("#docViewer1PagesContainer").attr(“tabindex”, 1).focus();
});

Best regards.



#3

okay, that worked! Just had to follow that command with


window.scrollTo(0, 0);

to get it to start at the top of the page.

Thanks again, Bill

#4

Hello Bill,


Thank you fro the notification. Glad to hear that you achieved your goal.

Best regards.