Simple problem with a simple chat script

D

dillon

Hi everyone

I'm writing a javascript/php chat script, but I've run into a problem
that is probably very, very simple to fix but I don't have a clue.

The problem is with an iframe (should I be using an iframe in the first
place?) that shows all the chat so far - all I want to do is get the view to
scroll to the bottom of that iframe when it first loads or refreshes.
That's the entire problem in a nutshell! Lines of text are added to the
bottom of the file shown in the iframe, but when the number of lines exceeds
the height of the iframe the vertical scrollbar appears (which is desirable)
but the new conversation is hidden off the bottom.

The reason for the iframe btw is that I couldn't find a compatible way
of updating part of a page without using form elements, and I want to use
things like different font colours for different users in the chat pane,
which I can't with form elements.

Any tips or a possible fix for this would be greatly appreciated, and
particularly cross-browser working example code :)

This has got a lot longer than I expected, I'd better go to bed now,

Cheers in advance to anyone who can help :)

dillon
 
H

higabe

I don't really have any exprience at this but since nobody else has
answered. Why don't you try:

window.scroll(0,99999999);

I don't know if it's cross-browser compatible or what but it's a start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top