...

View Full Version : How do I do this with inline frames?



chelvis
12-14-2005, 10:44 PM
I have an inline frame which displays a pdf document. The code is below. Now I have to have a "Next" and "Previous" link just above the IFrame and every time a user clicks on the link it should display the next pdf (say book2.pdf, book3.pdf etc). How do I do this?

<IFRAME SRC="book1.pdf" WIDTH=500 HEIGHT=600>
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
<A HREF="books.pdf">link</A>
you to the file.
</IFRAME>

_Aerospace_Eng_
12-14-2005, 10:55 PM
<iframe src="book1.pdf" name="books" width="500" height="600">
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
<a href="books.pdf">link</A>
you to the file.
</iframe>
Give the iframe a name, then target your links to the iframe.

<a href="book2.pdf" target="books">Book 2</a>

chelvis
12-15-2005, 05:31 PM
But if I want to show books dynamically, for example when the user clicks on the "next" link first time it will show book1.pdf then when he clicks on it the second time it should show book2.pdf etc. It should work exactly the same logic for previous page also. In this case I should write a Javascript is it? Here is my code

<center>
<table border="0" cellspacing="0" cellpadding="0" width="650">
<tr><td colspan="3"valign="top" height="20"><img src="images/s.gif" height="20"></td></tr>
<tr><td align="left"><a class="RedText"><b>&laquo;</b></a> <a class="MedBlueLink" href="book1.pdf" target="books">Previous Page</a></td><td valign="bottom" align="middle"><a class="MedBlueLink" href="#">Table of Contents</a><img src="images/s.gif" width="5" height="1"><a class="SmBlackText">|</a><img src="images/s.gif" width="5" height="1"><a class="MedBlueLink" href="#">Read Chapter</a><img src="images/s.gif" width="5" height="1"><a class="SmBlackText">|</a><img src="images/s.gif" width="5" height="1"><a class="MedBlueLink" href="#">Download Book</a></td><td valign="top" align="right"><a class="MedBlueLink" href="book3.pdf" target="books">Next page</a> <a class="RedText"><b>&raquo;</b></a></td></td></tr>
<tr><td colspan="3" height="4"><img src="images/s.gif" height="4"></td></tr>
</table>
</center>

<center>
<table border="0" cellspacing="0" cellpadding="0" width="600">
<tr><td height="1" colspan="3" bgcolor="#000000"><img src="images/s.gif" height="1"></td></tr>
<tr><td width="1" bgcolor="#000000"><img src="images/s.gif" width="1"></td>
<td valign="top">
<table border="0" cellspacing="0" width="100%">
<tr><td valign="top">
<IFRAME SRC="book2.pdf" NAME="books" WIDTH=600 HEIGHT=500>
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
<A HREF="book2.pdf">link</A>
you to the file.
</IFRAME>
</td></tr>
</table>
</td>
<td width="1" bgcolor="#000000"><img src="images/s.gif" width="1"></td></tr>
<tr><td height="1" colspan="3" bgcolor="#000000"><img src="images/s.gif" height="1"></td></tr>
</table>
</center>

chelvis
12-15-2005, 05:47 PM
I just tested my page with my previous code and it works very nice in IE. But when I try to view a PDF within IFrame in NN6, it doesnt work. Is there any issue with using PDF within IFrames? Is there any way to solve this problem?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum