Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML HTML Basics

Chat and frames

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

Chat and frames

Postby victor123 » Mon Jun 06, 2005 11:51 am

Hi,

I am designing a chat system. It has three frames: conversation, users and posting frame. The problem i have is that, in the conversation frame, the user has to scroll down to see the newest posts, which is not very nice.
I can solve it by limiting the number of messages displayed, but i know there must be a way to solve the problem. In the chats i know the last message is shown automatically and the user only has to scroll upwards if he wants to see earlier messages but not the last ones. Can somebody suggest a way to do it?

Many thanks in advance.
victor123
New php-forum User
New php-forum User
 
Posts: 192
Joined: Mon Sep 06, 2004 1:23 am
Location: Madrid, Spain

Postby Alexej Kubarev » Mon Jun 06, 2005 2:16 pm

easy as hell :)

put a named anchor at the bottom called bottom

then load this page: chat-frame.php#bottom
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby victor123 » Fri Jun 10, 2005 3:40 am

Thanks Alexei, it has worked partially... the problem now is that when you call chat-frame.php#bottom, it goes right to that point and skips all the rest, so that the new information is not displayed. Sounds a bit weird, i know...
victor123
New php-forum User
New php-forum User
 
Posts: 192
Joined: Mon Sep 06, 2004 1:23 am
Location: Madrid, Spain

Postby victor123 » Fri Jun 10, 2005 4:07 am

Sorry for the previous post, it was not very clear... let me explain: in chat-frame.php, i have a javascript function so that it provides auto-refreshing for the page. In this way chat-frame.php is updated.
This javascript function calls chat-frame.php#bottom

When you remove #bottom, auto-refreshing is performed ok and the new messages appear correctly (however the problem of the scroll persists). When you use #bottom, auto-refreshing is not performed correctly: the new messages do not appear.

Thanks for your help.
victor123
New php-forum User
New php-forum User
 
Posts: 192
Joined: Mon Sep 06, 2004 1:23 am
Location: Madrid, Spain

Postby Alexej Kubarev » Fri Jun 10, 2005 4:32 am

put a JS function AFTER the named anchor then or use Meta tags for autorefresh
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby frogrocker » Fri Jun 10, 2005 6:13 am

Can't you show new messages at the top?
User avatar
frogrocker
New php-forum User
New php-forum User
 
Posts: 98
Joined: Mon Jul 07, 2003 10:30 pm
Location: Manchester

Postby Alexej Kubarev » Fri Jun 10, 2005 6:19 am

this will be pretty bad as its not really nice look :) take a look at all other chats ;)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby frogrocker » Fri Jun 10, 2005 8:02 am

How do you know until you try? :D
User avatar
frogrocker
New php-forum User
New php-forum User
 
Posts: 98
Joined: Mon Jul 07, 2003 10:30 pm
Location: Manchester

Postby Alexej Kubarev » Fri Jun 10, 2005 8:07 am

I did before: its pretty irritating: its better to make it scroll down, and its possible to do so as well
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby victor123 » Mon Jun 13, 2005 6:14 am

Hi,

I sorted it out, it is not very elegant though. What i did was to use the js function to call a file 'temp.php' periodically. This file then does:

header('Location: chat_frame.php#bottom');

This works, but i rather try the solutions you have offered...

Thanks a lot.
victor123
New php-forum User
New php-forum User
 
Posts: 192
Joined: Mon Sep 06, 2004 1:23 am
Location: Madrid, Spain


Return to HTML Basics

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron