|
 |
pro_php thread: SV: refreshing and scrolling
Message #1 by "Datatal AB - Gauffin, Jonas" <jonas@d...> on Tue, 12 Nov 2002 08:41:30 +0100
|
|
Jonas:
while the theme is Javascript one question
i have made a standar window.open function
to call it on a page several times adjusted to the size of the picture it
will show
Some times the window size wont change and the window will open with the
dimensions of the first call to the function (the size iscached i guess) any
ideas??
Jorge
----- Original Message -----
From: "Datatal AB - Gauffin, Jonas" <jonas@d...>
To: "professional php" <pro_php@p...>
Sent: Tuesday, November 12, 2002 1:41 AM
Subject: [pro_php] SV: refreshing and scrolling
> If you use setTimeout and javascript instead it's easy to scrolldown to
the last position.
>
> Use this:
>
> <script language=JavaScript>
> <!--
> function ReloadPage()
> {
> //set scrolltop to the current position
> document.location = "mypage.php?a=1&scrolltop=" + document.body.scrollTop;
> }
> function OnLoad()
> {
> //Scroll down to the previous position
> self.scroll(0,<?= $_GET['scrolltop'] ?>);
>
> //3000 = your timeout.
> setTimeout('ReloadPage()',3000);
> }
> //-->
> </script>
> <body onLoad="OnLoad();">
>
>
> -----Ursprungligt meddelande-----
> Från: Olivier Toubia [mailto:toubia@m...]
> Skickat: den 11 november 2002 22:11
> Till: professional php
> Ämne: [pro_php] refreshing and scrolling
>
>
> I'm using PHP with a MySQL database.
> I want one page to be automatically updated, i.e. to instantly reflect
changes in the database
> without having to hit "refresh". I'm doing this using the command <META
> HTTP-EQUIV="Refresh" CONTENT="1 URL=..."> which automatically refreshes
the page every
> second. However when the page gets larger and the user scrolls down, the
page goes back to
> the top each time it refreshes itself, so that you have less than 1 second
to scroll!
>
>
|
|
 |