iaps
iaps

Reputation: 51

scroll position of html object tag

I am working on a project that pulls in a pdf document via the object tag <object data="the-url-to-the-document" class="ppa_document" type="application/pdf"></object> and I want to find out if the user has scrolled to the bottom of that embedded document to then enable the "i agree" checkbox. I tried it will the jQuery .scroll() function but that didn't work. Any suggestions? Considering Adobe Acrobat is a totally different interface, it may not be possible. On the other hand, it does become part of the DOM, so maybe it is possible!?

Upvotes: 4

Views: 2045

Answers (1)

user1454926
user1454926

Reputation: 199

For most DOM elements you could use the scrollTop property. For example:

var position = document.getElementById('elemId').scrollTop;

However, what happens inside of the <object> tag is a different story... In case of PDF files, Acrobat Reader is handling the scroll bars and I do not believe there is an API to get the scroll bar position. However, please correct me if I am wrong, as I'd love to know myself if there is such a thing.

Upvotes: 1

Related Questions