mplungjan
mplungjan

Reputation: 177860

Keyup/press events not available when page has PDF in iFrame (IE) or as object (Fx/chrome). Chrome's native reader behaves

We are implementing accessibility.

That means - among other things - keyboard navigation.

We have decided on new access keys and shift-arrow keys. This works just fine on all pages except where we embed a PDF. On those pages, only Chrome (which uses its own PDF viewer) is unaffected - IE6-8 and Fx9 does not allow any other keyboard access than access keys on such a page. No tabbing and no keyup/down detection and triggering

QUESTION: Is there by now (March 2012) any solutions to this known issue using jQuery or other means? I see suggestions from 2009 here, but no accepted answers and perhaps something came along and fixed it. We need to retain the keyboard navigation on all pages.

So we currently have shift-alt-1 and shift-alt-2 access keys on our pages to go next and previous in a list of results. This still works in Fx9+Reader9. Tab does not work. Fx10+reader10 does allow tabbing.

A change to javascript binding of shift-left and shift-right arrow works on all other pages than the ones with PDF.

Example URL using the old navigation (new navigation not available online so please use a bookmarklet or such to mess with the handlers) :

http://goo.gl/rl7oJ

click on the first link, navigate to a page with an active "Original document" in the left menu and click that. That is the page where we cannot change the handlers to shift arrow since the keyboard focus seems to be in the acrobat plugin (although the access keys DO work)

I know I am likely not to get any answers, but any suggestion welcome!

Some background:

We use PDF since it gives the highest resolution without any image manipulation on the server (de-compress plus compress) of our ccitt g4 scans. This cannot be changed and I would appreciate PDF haters to comment elsewhere.

We use iframe for IE browsers and object for the rest to embed the PDF - this can be changed if it gives a better solution to the issue at hand. Please note that we use the embeds/iframes to control the pdf from our own navigation bar since we only show one page at a time for robot reasons. the one page at a time and navigation from outside of the iframe/embed can also not be changed.

Upvotes: 0

Views: 618

Answers (1)

Bert Vandierendonck
Bert Vandierendonck

Reputation: 36

This is most likely the result of focus problems.

While attempting to do something very similar (I use iFrames across all browsers), I found that when loading a PDF in the frame, the frame always steals focus.

Programmatically giving focus to anything other than the frame should enable regular tabbing and such.

Mind you, you will then be faced with another problem, because the iFrame steals focus on several occassions. Most importantly, when the PDF is fully rendered, it will steal focus one last time. Unfortunately, there is no way to detect this, so you're left with only one option: using setTimout with an estimate (I use 1 sec/Mb for my setTimeout).

Upvotes: 1

Related Questions