View Full Version : frames and scrolling

05-19-2005, 12:42 PM
using frames from my own chat and i use the top frame as the display window and the bottom frame as my input....

can i force the top window to always scroll to the bottom so that the latest post is always shown after each refresh....

the page can be seen here (http://testing1234.tollfreepage.com/chat/).

05-20-2005, 05:30 AM
Change this in the chat.php

<meta http-equiv="refresh" content="7" />

to this:

<meta http-equiv="refresh" content="7;chat.php#lastpost" />

Then when chat.php generates the page, dynamically put an anchor in the last message.

<a name="lastpost" id="laspost"></a>
<b>sysop ;):</b>stripslashes()...<br />

05-20-2005, 06:10 AM
if i add this <a name="lastpost" id="laspost"></a> to every post how do i remove it from the previous one.....

05-20-2005, 10:46 AM
You are dynamically displaying the messages using php, right? So there must be a loop to display each line of messages. If you're in the last iteration of the loop, output that anchor before the last message.

05-20-2005, 12:37 PM
Or you could print it after the loop:

echo '<a name="bottom" id="bottom" />';