Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframe text, first and last 1

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
CA
Hi everyone,

having an iframe that displays text records from a database seperated (in the html) by a line (<hr />)
I not sure whow to control the messages in the iframe. I have mainpage.html that has a link called first and a link called last. I would like these links to go to the begining of the iframe content (iframe has a scroller) and the last link to display the end content of the iframe. ot sure how to go about this.

this is the iframe:
<html><head></head>
<body style='overflow-x:hidden; overflow-y: auto'>
<table>
<tr>
<td width='315'>
<font face='Courier'>i frame text here<br><hr /><br> some more text<br><hr /><br>
and some more
<br><hr /><br>
blah blah
<br><hr /><br>
almost done...

</font></td></tr></table></body></html>

The iframe can only be a certain size so i'm hoping the first link and last link can be like anchors to the iframe text, last link goes to the bottom while first goes back to the top.
 
Use regular anchors to do the job. Place this at the start of your iframe text:

Code:
<a name="beginning"></a>

and this at the end:

Code:
<a name="end"></a>

and then simply use:

Code:
<a href="#beginning">Go to top</a>

and

Code:
<a href="#end">Go to bottom</a>

respectively. You can add a target attribute if the links are not in the iframe:

Code:
<a href="#beginning" target="iframeNameGoesHere">Go to top</a>

etc.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top