webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

Change Iframe SRC dynamically #154

Open faruq1256 opened 9 years ago

faruq1256 commented 9 years ago

Hi,

I have a requirement of changing the iframe src dynamically when user clicks on different links. Basically need to display different pdfs in the iframe.

Could anyone help me out on my issue. Thank you in advance.

Regards, Faruq Shaik.

fmp777 commented 8 years ago

This is likely not a ViewerJS issue. All you need to do is create an iframe with src to ViewerJS/index.html#yourpdffile

Then from parent page, just update the SRC of that iframe with new pdffile hash.

ie jquery: $('#youriframe').src('ViewerJS/index.html#yourNewPDF')