Page 1 of 1
animating table height...
Posted: Wed Nov 06, 2002 6:14 am
by runelore
Hi what I want is to have a table's height increase with each cycle of the loop, this is my code and please can someoen tell me how to get this effect... thanks for all help..
<?php
$height='0';
$number='20';
while ($number >= '0')
{
echo "<table width=400 height=$height border=1 cellspacing=0>";
$height=$height+5;
$number=$number-2;
usleep(200);
}
echo "</table>";
?>
Posted: Wed Nov 06, 2002 6:26 am
by twigletmac
I'm a bit confused by why you want this effect - could you explain a bit more what you are trying to achieve and why.
Thanks,
Mac
Posted: Wed Nov 06, 2002 6:31 am
by runelore
to be honest, i am just trying a few effects for a new site we are designing and thought it would be cool to be able to do such a thing fopr say a menu rollout without using Dhtml.... thus all serverside....
Posted: Wed Nov 06, 2002 6:37 am
by twigletmac
Don't forget that server-side means that everything is done on the server before anything is displayed in the browser. Client-side effects have to be done using client-side technologies. You'll need to keep refreshing the page to have a table change its height using PHP.
Mac
Posted: Wed Nov 06, 2002 6:43 am
by runelore
oh, sort of forgot about that one/... so isn't there any way of doing it then?
Posted: Wed Nov 06, 2002 6:46 am
by runelore
one query though, when I query a database for results and there ar a lot of results it actyually populates the page in real-time and doesn't run the whole script before outputting.... for an example, go to my site,
http://www.kermin.com and in the advanced search type hotels...
Posted: Wed Nov 06, 2002 8:26 am
by volka
that's because your output is not buffered or the buffer is flushed. Everything that is in that buffer is sent to the client and the buffer is empty again.
Most browsers display partial documents as soon as they can.
Posted: Wed Nov 06, 2002 8:45 am
by runelore
how do I stop it from displaying the partial document... I want it to fetch all the results first and then display the results.
Posted: Wed Nov 06, 2002 9:05 am
by volka
I try to avoid this question, but "why?"
anyway, take a look at
LXXV. Output Control Functions @online-manual