Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I do this with inline frames?

    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>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <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.
    Code:
    <a href="book2.pdf" target="books">Book 2</a>

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •